arg

Format:
arg(int_expr arg_no)
Result:
Number, text
Description:
Returns the arg_no$^{th}$ argument. This function is used in command files. It is recommended to use arg() instead of P1, P2... because the arg() function fetches the argument from a stack. That makes the calling mechanism recursive, i.e.: Command files can be called from command files. Each call may have different arguments. SPECTRA keeps track of the calling level. The number of arguments is returned by the n_arg() function.
e.g.:
SPECTRA> run com_file arg1 arg2

! 
! com_file.gra 
! 
  if (n_arg() $<$ 2) 
    say " This file requires at least 2 arguments " 
    end 
  endif 
  read arg
  ...