──ARG(─┬───────────────────┬─)─────────── └─n──┬───────────┬──┘ └─,option───┘
ARG returns an argument string, or information about the argument strings to a program or internal routine.
If you do not specify a parameter, the number of arguments passed to the program or internal routine is returned.
If only n is specified, the n th argument string is returned. If the argument string does not exist, the null string is returned. n must be a positive whole number.
If you specify option, ARG tests for the existence of the n th argument string. Valid options (of which only the capitalized letter is significant and all others are ignored) are:
Exists
Here are some examples:
/* following "Call name;" (no arguments) */ARG( ) -> 0 ARG(1) -> '' ARG(2) -> '' ARG(1,'e') -> 0 ARG(1,'O') -> 1 /* following "Call name 'a',,'b';" */ ARG( ) -> 3 ARG(1) -> 'a' ARG(2) -> '' ARG(3) -> 'b' ARG(n) -> '' /* for n>=4 */ ARG(1,'e') -> 1 ARG(2,'E') -> 0 ARG(2,'O') -> 1 ARG(3,'o') -> 0 ARG(4,'o') -> 1
Notes: