Generic Command Line Parser for Delphi 10.3.x

You know the feeling. You need a specific input from your command line, but you can’t find something lightweight that does the job. Hence, the FDC.CommandLine was born.

Creative Commons Licence
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

You can use – / or + as a switch, and use : or = as a flag for parameters.

You can use single and double quotes to be able to parse parameters that contain spaces and quotes.
/quoteoftheday:”This is a ‘quoted’ parameter”

It also supports lists of parameters.
/inputfiles:(file1.txt , “file with space.txt”)

Take a look at the TestFDCCommandLine.dpr for more examples of how it works.

Continue reading “Generic Command Line Parser for Delphi 10.3.x”

Delphi pitfalls: Enumerated types and for loops

Not all for loops are created equal.

for x in [value1, value2, value3]

You would expect to see x vary in the order of the values in the list.

However – if x and the values are of an enumerated type, looping the “list”
does NOT loop in the apparent order of the constant, but in the order of the enumerated type declaration, such as it would for any set.

Continue reading “Delphi pitfalls: Enumerated types and for loops”

Delphi: Pitfalls of Anonymous methods and Capture

I was writing a web request handler when I ran into a problem. I was plugging in multiple handlers, but only one of them actually worked.


To get to the essence of it, this doesn’t work

procedure TMyClass.Setup;
  Handler: THandlerClass;
  hType: THandlers;
  for hType in [foo, bar]
  do begin
    case hType of
      foo: Handler := TFoo.Create;
      bar: Handler := TBar.Create;

Zipped example source code:

Continue reading “Delphi: Pitfalls of Anonymous methods and Capture”

Delphi Developers Archive (Experimental)

Delphi Developers Archive (Experimental)


The posts are searchable by tag list or free text search.


FYI – This is work in progress, and I hope to improve the following issues:

– Some posts have erroneous titles

– Some posts are missing attribution of the original poster

– Some 600 posts are missing due to an inexplicable quota error during import


Comments on the archived posts are currently disabled until the import is finalized.

We are looking for an experienced Delphi developer for a permanent position in our Industrial IT team at TINE SA,…

We are looking for an experienced Delphi developer for a permanent position in our Industrial IT team at TINE SA, Norway’s largest dairy product company.

About TINE:

Language and Location requirements

You must be able to speak/read/write Norwegian and English fluently, and be able to work at TINE’s offices at Kalbakken in Oslo.

Coding skills you need

– Modern Delphi OOP code with generics and attributes

– Delphi VCL / Windows APIs / FireDAC

– MS SQL Server T-SQL and SQL queries in general

– Basic http/tcp/udp networking

– XML/JSON knowledge

Coding skills that would be nice

– Delphi FireMonkey on iOS/Android


– MS PowerShell


Bonus skills that come in handy

– Datawarehousing and big data

– IoT (the buzz, the hype, the stuff that works)

– Knowledge of the various aspects of Logistics and exchanging information between actors (GS1)

– Jira/SVN/git experience

Person skills we really appreciate

– Open and honest and not afraid to speak your mind

– Able to communicate clearly in writing

– Works well with others and can take and give positive feedback

– Willing to learn and adapt, as well as share and mentor

– Able to focus on and prioritize tasks, putting need before cool/fun

You have been programming for a while and can document your experience.

Please send your questions to

lars.fosdal (at)

Please note: Official posting will come later.