value_specifier is a substring_specification string record. This space-separated record therefore has 2 fields. The substring_specification has three possible values: #, *, and N, where N is an integer digit.
The first specification (#) specifies that the variable's value is the count of space-separated tokens in the string.
The second specification (*)
specifies that the variable's value is the string less the first token. This is analogous to a SHIFT LEFT operation, with the first token being discarded.
The last specification (0-N) specifies that the variable's value is the Nth token in the string, thus serving as an INDEX operation.
Example:
Set FIVE to the fifth item in %LIST%, and set NUM to the number of items. Set RESTLIST to %LIST% less the first token.
SET STR FIVE=5 %LIST%
SET STR NUM=# %LIST%
SET STR RESTLIST=* %LIST%
|