×
Menu
Index

ARG, ARGC Subroutines

 
Usage:
a = ARG(n)
n = ARGC()
 
Description:
The ARG and ARGC subroutine are used to access any arguments that were passed on the command line (when the script was started). ARGC returns the number of arguments. ARG() returns the argument indicated by n, which can be in the range 1 through the value returned by ARGC.
 
In addition to the arguments described above, the ARG subroutine returns the fully qualified path of the script file when n = 0.
 
Example:
sub main()
   printl("Script name = ", arg(0))
   for i = 1 to argc()
      printl("Arg ", i, " = ", arg(i))
   next
end sub