Demonstrates how Read parameters from command prompt in Delphi
Demonstrates how Read parameters from command prompt in Delphi using ParamCount / ParamStr.
Bookmark:
Demonstrates how Read parameters from command prompt in Delphi
Demonstrates how Read parameters from command prompt in Delphi.

This one counts and read command line parameters.
procedure TForm1.FormCreate(Sender: TObject);
Var
I : Integer;
begin
Memo1.Lines.Clear;
Memo1.Lines.Add('Parameters Count : '+IntToStr(ParamCount));
{ ParamCount - Returns the number of parameters passed on
the command line. }
If ParamCount>0 Then
For I:=1 To ParamCount Do
{ ParamStr - Returns a specified parameter from the command-line. }
Memo1.Lines.Add('Parameter '+IntToStr(I)+' : '+ParamStr(I))
end;
Download This Delphi Tutorials.
Download materials for this article (Delphi - Tutorials)
Read-command-line-parameters.zip
File size: 7 KB, File type: zip
Total downloads: 155, Upload date: February 02 - 2009
ceri :: January 08-2010 :: 06:43 AM
I have just downloaded & run:
Demonstrates how Read parameters from command prompt in Delphi,
although it works, i cannot see where it gets the text from,
I want to run a DOS Prompt (command line programmer)
and i need to read back the results ?