Previous: 4.67.2.58. ParamCount function To the Table of Contents Next: 4.67.2.60. Pi function
4.67.2.58. ParamCount function Table of Contents 4.67.2.60. Pi function

- 4.67.2.59. -
Table of Contents
4. Standard Units
4.67. System - Built-in routines
4.67.2. System Unit Procedures and Functions
4.67.2.59. ParamStr function


4.67.2.59. 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: 4.67.2.58. ParamCount function To the Table of Contents Next: 4.67.2.60. Pi function
4.67.2.58. ParamCount function Table of Contents 4.67.2.60. Pi function

- 4.67.2.59. -