Next: , Previous: String Operations, Up: Library Routines

6.10.3 Accessing Command Line Arguments

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

The program below accesses the command line arguments.

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