>>-ARG(--+----------------+--)--------------------------------->< +-n--+---------+-+ +-,option-+
1
if the nth argument exists; that is, if it was explicitly specified when the routine was called. Otherwise, it returns 0
.
1
if the nth argument was omitted; that is, if it was not explicitly specified when the routine was called. Otherwise, it returns 0
.
Example 7.8. Builtin function ARG
/* following "Call name;" (no arguments) */ ARG() -> 0 ARG(1) -> "" ARG(2) -> "" ARG(1,"e") -> 0 ARG(1,"O") -> 1 ARG(1,"a") -> .array~of() /* 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 ARG(1,"A") -> .array~of(a, ,b) ARG(3,"a") -> .array~of(b)
ARG(n,"e")
returns 1
or 0
if there are no explicit argument strings. That is, it is the position of the last explicitly specified argument string.