The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20140508-Delphi-2007--Project-Options--Cannot-Edit-Application-Title-HelpFile-Icon-Theming

    20140430-Fiddler-Filter-Actions-Button-Run-Filterset-now

    20140424-Windows-7-free-disk-space

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,477 other followers

Archive for the ‘Delphi’ Category

Woot: AsciiImage for Delphi http://memnarch.bplaced.net/blog/?p=129

Posted by jpluimers on 2015/05/21

Woot!

AsciiImage for Delphi by Alexander Benikowski on GitHub repository Memnarch/AsciiImage..

AsciiImage for Delphi

AsciiImage for Delphi

–jeroen

via: And here it is: AsciiImage for Delphi http://memnarch.bplaced.net/blog/?p=129.

Posted in Delphi, Development, Software Development | Leave a Comment »

On the Delphi TCommandParser class for parsing command-lines and arguments (via: Suggestions for how to define command line parameters – Stack Overflow)

Posted by jpluimers on 2015/05/13

A while ago, I posted the below StackOverflow answer. Recently a friend asked me about command-line parsing in Delphi, so here is the re-run:

Delphi contains a really nice unit called CommandParser with a TCommandParser class that does commandline parsing for you. Since it has virtually no documentation, here are a few things to get started. It works even in Delphi 2007.

I have a HiddenExecutable example at our open source bo repository.

Basically you:

  • setup a TComponent that contains the properties you want to expose as commandline parameters (that is THiddenExecuteSettings in the HiddenExecuteSettingsUnit
  • a commandline parser controller. In our case THiddenExecuteArguments in theTHiddenExecuteArgumentsUnit (in retrospect not such a good name) that contains an InitCommandLine method that sets up a TCommandParser instance passing it your TComponent
  • It then executes a couple of AddSwitch calls to setup the parameters with both abbreviated and full commandline switches (like h and help)
  • You can then call the ProcessCommandLine method on the TCommandParser instance to process the commandline and fill the properties of your TComponent (in my example, this is done in the ProcessCommandLine method).

Now comes the fun:

  • The TCommandParser has a HelpText method that fully automatically assembles a helptext based upon what you fed it with the AddSwitch methods.
  • The TCommandParser also has a SaveOptions method that allows you to save the current settings of your TComponent into a settings file.

The Delphi units you need are these which you can get from the Embarcaderoradstudiodemos.sourceforge.net demo repository:

CommandParser in '...\radstudiodemos.sourceforge.net\branches\RadStudio_XE2\Delphi\Database\dbExpress\Utils\CommandParser.pas',
PropertyHelpers in '...\radstudiodemos.sourceforge.net\branches\RadStudio_XE2\Delphi\Database\dbExpress\DbxDataPump\PropertyHelpers.pas',
ParseIds in '...\radstudiodemos.sourceforge.net\branches\RadStudio_XE2\Delphi\Database\dbExpress\DbxDataPump\ParseIds.pas',

Edit: John Kaster wrote a nice article on EDN that includes more details on using the TCommandParser.

–jeroen via: delphi – Suggestions for how to define command line parameters – Stack Overflow.

Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development | 4 Comments »

Delphi Component vendors: when you ship source code, make it IDE-browsable as well by compiling with $YD or $Y+

Posted by jpluimers on 2015/05/06

It took me a while to figure this one out:

When you have a registered Delphi, you can Ctrl-Click browse both the units and symbols of RTL, VCL, etc. But Delphi will not recompile these units.

Some third party components you cannot Ctrl-Click browse the units or symbols, unless you put the source directory in the Delphi Library Path (which causes them to be compiled each and every time).

This is because:

  • the precompiled DCUs are in the Delphi Library Path.
  • the source code is added to the Delphi Browsing Path (and sometimes not even that).
  • the DCUs don’t contain information that the source code is Browsable or Referencable as it was compiled with {$Y-}.

These are the possible values for that directive:

  1. {$Y-} or {$DEFINITIONINFO OFF} or {$REFERENCEINFO OFF},
  2. {$Y+} or{$REFERENCEINFO ON},
  3. {$YD} or {DEFINITIONINFO ON}

So please component vendors: when you ship source code, make it IDE-browsable as well by compiling with $YD or $Y+.

–jeroen

via:

Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Development, Software Development | 2 Comments »

Lars Fosdal: VS/C#6 is out-delphi-ing Delphi. I hope EMBT is paying attention. Currently…

Posted by jpluimers on 2015/05/01

Interesting, Lars Fosdal writes:

VS/C#6 is out-delphi-ing Delphi.

I hope EMBT is paying attention.

Currently live at http://channel9.msdn.com/

I already liked the 7 minute C#6 video from last year. This is even better.

–jeroen

via: VS/C#6 is out-delphi-ing Delphi. I hope EMBT is paying attention. Currently….

Posted in .NET, C#, C# 6 (Roslyn), Delphi, Development, Software Development, VB.NET, VB.NET 14.0 | 10 Comments »

Some interesting demographics on the G+ Delphi Developers community

Posted by jpluimers on 2015/04/28

Stefan Glienke started some interesting demographics polls on the G+ Delphi community.

Demographics are about group members that actually voted. Which might rule out Delphi programmers not writing English well.

Despite that, I think it actually tells a lot, especially when you read the comments as well.

And it made DavidI provide some background on the geographic distribution: Where in the world are programmers using Delphi? – Blogs.

–jeroen

Posted in Delphi, Development, Software Development | 3 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 1,477 other followers

%d bloggers like this: