CRE Programmer's Guide

String and Memory Block Functions
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
8-15
Stptok
Considerations
A symbol consists of an alphabetic character followed by zero or more
alphanumeric characters and terminated by a blank character.
White space is not skipped.
The end of str is defined by the location of a zero (null) byte.
To ensure space for a null byte after the symbol, the value you pass in symlen
must be at least one greater than the longest symbol that can be scanned.
Example
STRING .s[0:17] := ["ident1 ident2",0];
STRING .symbol[0:9];
STRING .next;
!@next gets @s[6]
!symbol gets ["ident1", 0]
@next := RTL_Stpsym_(s, symbol, 10);
Stptok
The Stptok functions scan for the next token in a string. A token consists of all
characters from the beginning of the string up to, but not including, any character that
appears in a second string, a string of delimiter characters. These functions are not
available in the native CRE library.
str
is a pointer to the string to scan.
token
is a pointer to the string to which the token is copied.
INT PROC RTL_Stptok_( str, token, tokenlen, stop_chars );
STRING .str; ! in
STRING .token; ! out
INT tokenlen; ! in
STRING .stop_chars; ! in TNS only
INT(32) PROC RTL_StptokX_( str, token, tokenlen, stop_chars
);
STRING .EXT str; ! in
STRING .EXT token; ! out
INT tokenlen; ! in
STRING .EXT stop_chars; ! in TNS only