TRN_STOK[x]
Substitute token
Description:
Substitute a value for a token in a text string. The
VALUE supplied is formatted as a character string (if necessary) and used to replace all valid
occurrences of the TOKEN sub-string in the TEXT supplied. The substitution is not recursive.
Invocation
CALL TRN_STOK[x]( TOKEN, VALUE, TEXT, NSUBS, STATUS )
Arguments
TOKEN = C
The token string.
VALUE = ?
The value to substitute.
TEXT = C
The text to be
processed.
NSUBS = I
Number of substitutions made.
STATUS = I
Inherited error status.
Notes:
- There is a routine for each standard type x. Replace x by I (integer), R (real) or D
(double precision). Omit x altogether if a character string is being supplied for the VALUE
argument.
-
When VALUE is a numerical quantity, the token replacement will be enclosed in parentheses if it is
negative.
-
To be replaced, a token sub-string within TEXT must be correctly delimited
(i.e. surrounded by non-alphanumeric characters). It may also be enclosed in angle brackets
(e.g. a_token),
in which case the brackets will be regarded as part of the token and will also be replaced.
-
To be valid, a token must begin with an alphabetic character and contain only alphanumeric
characters (including underscore). It may be of any length. No embedded blanks are allowed.
Copyright © 2000 Council for the Central Laboratory of the Research Councils