The paramcount function


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




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);
      writeln('Number of program arguments =', paramcount)

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


Operating Systems: All
Standard Pascal: No