[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 8.10.3 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.

This document was generated by Frank Heckenbach on May, 10 2002 using texi2html