The paramcount function

Description

The paramcount function returns the number of arguments passed to the program. The type of the value returned by this function is always integer.

Parameters

None.

Example

For example, the following is a simple program args.pas, that uses the paramcount function to display the number of arguments passed to it.

   program args(output);
   begin
      writeln('Number of program arguments =', paramcount)
   end.

If you run the program with four arguments like below

    ivm args this is a test

then the output would be

    Number of program arguments = 4

since four arguments were passed to the program

  1. this
  2. is
  3. a
  4. test

Portability

Operating Systems: All
Standard Pascal: No