Previous: ParamCount function To the Table of Content Next: Pi function

- 4.62.2.59 -
Standard Units
System Unit
System Unit Procedures and Functions

ParamStr function

Targets: MS-DOS, OS/2, Win32


System Unit

Returns a specified command-line parameter.

Declaration:
function ParamStr(Index: Longint): String;
Remarks:
If Index is zero then the path and file name of the current program is returned. Command line parameters are separated by spaces or tabs. To determine the number of command line parameters use ParamCount.

Example:
{$ifndef __CON__}
  This program must be compiled as console application only
{ $endif}
var 
  Cnt: Longint;
begin
  WriteLn('Program Name: ',ParamStr(0));
  if ParamCount = 0 then Halt(0);
  for Cnt := 1 to ParamCount do 
    WriteLn(ParamStr(Cnt));
end.



Previous: ParamCount function To the Table of Content Next: Pi function
ParamCount function Table of Content Pi function

- 4.62.2.59 -