Talk:Console parameters/de

From Free Pascal wiki
Jump to navigationJump to search

Why reinvent the wheel?

Rather than code like

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

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)