5-82 Command Reference
TOKEN
Purpose Sets a token delimiter or extracts a token-delimited sub-field from a larger field.
Syntax To set a token delimiter:
TOKEN DELIMETER
character
[
,
[
invalid label
] [
, valid label
] ]
To extract a sub-field:
TOKEN
buffer-field1
,
buffer-field2
[
,
[
invalid label
] [
, valid label
] ]
Process The TOKEN command sets
character
as the token delimiter or extracts a sub-field
from
buffer-field1
(delimited by
character
) and places it in
buffer-field2
.
Subsequent calls to this command using the same fields returns the next sub-
string. You must set the delimiter before extracting sub-fields (the default is a
comma).
Character, buffer-field1 and buffer-field2
can be one of the following:
Character, buffer-field1
and buffer-field2
Description
INPUT Input Buffer
Logical Field Name
(TEMP1)
Temporary Buffer
Field
Logical Field Name (LU1) Lookup Buffer Field
Logical Field Name (PR1) Printer Buffer Field
Logical Field Name
(Field1) [Index]
Array Buffer Field
SCRATCH Scratch Buffer Field
String An ASCII string
delimited by double
quotes
Number A number prefixed by
a number sign (#)
Optional Fields
Invalid
and
valid labels
are discussed in "Script Flow" at the beginning of this
chapter. The exception is as follows:
Example
This example sets the token delimiter to *. Then, it extracts the strings PAXAR and
CORPORATION from TASOURCE and moves them to the printer’s screen one at a
time.
MOVE “PAXAR*CORPORATION”, TASOURCE
TOKEN DELIMITER, “*”
*GETTOKEN
TOKEN TASOURCE, TATOKEN, *DONE
MOVE TATOKEN, DISPLAY
JUMP *GETTOKEN
*DONE