-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathARG.HELPREXX
56 lines (43 loc) · 1.82 KB
/
ARG.HELPREXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
ARG instruction and function
+-----------------------------------------------------------------------------+
| ARG [parse_template] |
+-----------------------------------------------------------------------------+
Parse the argument string to an EXEC or a routine within an EXEC. The
argument string's value is translated to upper case before parsing. This is
an exact shorthand for:
PARSE UPPER ARG [parse_template]
See the PARSE instruction for further information.
+-----------------------------------------------------------------------------+
| ARG([n[, option]]) |
+-----------------------------------------------------------------------------+
Returns information about, or the content of, the argument string passed to
an EXEC or to a routine within an EXEC.
Variants:
ARG()
returns the number of arguments.
ARG(n)
returns the value of the nth argument, counting from 1.
ARG(n, option)
returns an indication of whether the nth argument exists, depending
upon the option value. When the upper-cased first character of the
option is 'E', the function returns 1 if the argument was specified
(even as an empty string), and 0 otherwise. When 'O', the function
returns 1 if the argument was omitted, and 0 otherwise.
Examples:
/* Following "Call name;" (no arguments) */
ARG() == 0
ARG(l) == ''
ARG(2) == ''
ARG(1, 'e') == 0
ARG(l, 'o') == 1
/* Following "Call name 1,, 2;" */
ARG() == 3
ARG(1) == 1
ARG(2) == ''
ARG(3) == 2
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