GETARG - ***OBSOLETE*** use SCAN.

Usage:

extrn .gtrgc;
...
pos = getarg( arg, string, pos [, delimiters] );

Description:

The string "delimiters" contains all the characters that GETARG is to regard as argument delimiters. If it is not supplied, it is assumed to be: " *t" (that is, a blank and a tab).

Starting from position "pos" in "string", GETARG copies characters from this point in "string" into the start of "arg" until either the end of "string" is reached, or one of the delimiters in "delimiters" is found. Then GETARG ends the string "arg", and returns the position in "string" where the scan stopped.

If blank and tab are specified as delimiters, they are treated in a rather special manner, in that leading blanks and tabs are ignored in the search for characters to fill "arg" with.

Thus given the string:

"  hi;;;###there"

then the call

p = getarg(arg1, string, 0, ";# ");
p = getarg(arg2, string, p, ";# ");

will set "arg1" to "hi" , and "arg2" to "" . ("Arg2" gets set to the null string, as the ";;" in "hi;;" are assumed to delimit the null string.)

The delimiter that caused the scan to stop is stored in the external .GTRGC. So in the example above, after each call to GETARG, .GTRGC would contain a ";".

Copyright © 1996, Thinkage Ltd.