| |
The
following ARG function options are +PxPlus
Exclusive
|
| Format |
1.
Return
argument from string:
ARG(
string$, argno [, delim$ ] [,ERR=stmtref])
2. Replace argument in string
:
ARG ( EDIT string$,
argno, newval$ [, delim$ ] [,ERR=stmtref])
Where:
|
| |
string$ |
String
containing a series of arguments/values each separated by
a single character. |
| |
|
| |
argno |
The number
of the argument in the string to return or relpace. (one
based) |
| |
|
| |
delim$ |
The
character that separates each of the values string$.
If omitted the system default field separator is used. |
| |
|
| |
newval$ |
The new
value to insert into string$. |
| |
|
| |
stmtref |
Program line
number or statement label to which to transfer control. |
| |
|
| Format
1 |
This
form of the ARG function extracts a specific field from a
delimited string. If no delimiter is specified, the
system uses the default SEP character (normally $8A$). |
| |
|
| Format 2 |
This
form of the ARG generates and returns a new string
replacing the field specified with that supplied in
<newvalue>. If the field specified did not exist,
additional delimiters will be added in the string to make
up for the missing fields. If no delimiter is specified,
the system uses the default SEP character. |
| |
|
| Example |
Given
X$ = "a,b,c,d,e,"
| |
|
| ARG(X$,
1, ",") |
Returns
"a" |
| ARG(EDIT
X$, 2, "Cat", ",") |
Returns
"a,Cat,c,d,e," |
| ARG(EDIT
X$, 7, "Dog", ",") |
Returns
"a,b,c,d,e,,Dog," |
|