The args command returns the list of arguments of a function.
Note that args() will not work, the command must be called as args or args(NULL). You can also use (args)[0] to get the name of the function and (args)[1] to get the first argument, etc., but the parentheses about args is mandatory.
Examples.
testargs():= {local y; y:= args; return y[1];} |
testargs(12,5) |
12 |
total():={ |
local s,a;} |
a:=args; |
s:=0; |
for (k:=1;k<size(a);k++){ |
s:=s+a[k]; |
} |
return s; |
} |
10 |