-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDATATYPE.HELPREXX
38 lines (32 loc) · 1.55 KB
/
DATATYPE.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
DATATYPE function
+-----------------------------------------------------------------------------+
| DATATYPE(string, [type]) |
+-----------------------------------------------------------------------------+
If the type is omitted, this function returns 'NUM' if string is a number
(i.e., can be added to '0' without an error), or 'CHAR' if not.
If the type is specfied, this function returns 1 if the string is a valid
value for the specfied type (only the first character of the type, upppercased,
is checked). The types are:
A - Alphanumeric (i.e., composed only of 'a'-'z', 'A'-'Z', and '0'-'9')
B - Binary (i.e., composed only of '0', and '1', with blanks allowed between
quartets of characters)
L - Lower case (i.e., composed only of 'a'-'z')
M - Mixed case (i.e., composed only of 'a'-'z', 'A'-'Z')
N - Number (i.e., if DATATYPE(string) would return 'NUM')
S - Symbol (i.e., string is a valid REXX symbol)
U - Upper case (i.e., composed only of 'A'-'Z')
W - Whole number (i.e., a number within the current NUMERIC DIGITS setting)
X - Hexadecimal (i.e., composed only of 'a'-'f', 'A'-'F', and '0'-'9', with
blanks allowed between pairs of characters)
Examples:
DATATYPE(' 12 ') == 'NUM'
DATATYPE('') == 'CHAR'
DATATYPE('l23*') == 'CHAR'
DATATYPE('l2.3','N') == 1
DATATYPE('12.3','W') == 0
DATATYPE('Fred','M') == 1
DATATYPE('','M') == 0
DATATYPE('Minx','L') == 0
DATATYPE('3d?','s') == 1
DATATYPE('BCd3','X') == 1
DATATYPE('BC d3','X') == 1