NET/MASTER Network Control Language (NCL) Reference Manual

WORD
Built-in Functions
106126 Tandem Computers Incorporated 4–105
WORD The WORD built-in function extracts a specified word from a string.
WORD(
string
,
n
)
string
specifies the string from which the word is to be extracted.
n
specifies the word position (counted from the left of the string) of the required
word.
n
must be a positive whole number. If
n
specifies a word position beyond
the end of the string, a null string is returned.
Consideration
See also SUBWORD, which extracts a substring from a string, starting from a specified
word in the string.
Examples
In the following example, the second word of the string “This is a message” is
returned. The output string is “is”:
&A = This is a message
&B = 2
&RESULT = WORD(&A,&B)
In the following example, the sixth word of the string “This is a message” is to be
returned. The output string is a null string because there are only four words in the
given string:
SAY WORD(This is a message,6)