Talk:Console parameters/de

From Free Pascal wiki
Revision as of 13:12, 21 February 2014 by BigChimp (talk | contribs) (Why not FPC-provided options code?)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Why reinvent the wheel?

Rather than code like <syntaxhighlght>

 for intI := 1 to ParamCount do
 begin
   // Wandelt den Parameter in Kleinbuchstaben um
   case LowerCase(ParamStr(intI)) of

</syntaxhighlight>

why not simply use Project/New Console Application, make sure Code Generator Options/Check Options is used then you can use

  // parse parameters
  if HasOption('h','help') then begin
    WriteHelp;
    Terminate;
    Exit;
  end;

etc.. ?

--BigChimp 12:12, 21 February 2014 (CET)