Command line switches

I need help creating a program that will accept command line switches. I do not have a clue where to begin

Any one got any pointers?


Steve
stephenarnottAsked:
Who is Participating?
 
geobulCommented:
Hi,

See ParamCount and ParamStr functions.

Regards, Geo
0
 
TOndrejCommented:
Also see FindCmdLineSwitch in SysUtils
0
 
geobulCommented:
From Delphi help:

procedure TForm1.FormCreate(Sender: TObject);

var
  i: Integer;
  for i := 0 to ParamCount ? 1 do
  begin
    if LowerCase(ParamStr(i)) = 'beep' then
      Beep(10000,1000)
    else if (LowerCase(ParamStr(i)) = 'exit' then
      Application.Terminate;
  end;
end;

Regards, Geo
0
 
stephenarnottAuthor Commented:
Fast Answers always the best
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.