Node:Accessing Command Line Arguments, Next:Memory Management Routines, Previous:String Operations, Up:Library Routines

#### Accessing Command Line Arguments

GPC supports access to the command line arguments with the BP compatible `ParamStr` and `ParamCount` functions.

- `ParamStr[0]` is the program name,
- `ParamStr[1] .. ParamStr[ParamCount]` are the arguments.

The program below accesses the command line arguments.

    program CommandLineArgumentsDemo (Output);

    var
      Counter: Integer;

    begin
      WriteLn ('This program displays command line arguments one per line.');
      for Counter := 0 to ParamCount do
        WriteLn ('Command line argument #', Counter, ' is `',
                 ParamStr (Counter), '''')
    end.