CRE Programmer's Guide

String and Memory Block Functions
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
8-5
Stccpy
Return Value
The Stcarg functions return the number of bytes scanned at the beginning of str
before a character in
stop_chars was encountered. If no characters from
stop_chars are found in str, the Stcarg functions return the length of str.
Considerations
The Stcarg functions scan str until any character in stop_chars is found in str
or until they encounter a zero (null) byte in str.
The Stcarg functions ignore text in str that is inside matched single or double
quotes or that follows an unmatched single or double quote. They also ignore any
character that is preceded by a backslash.
Both str and stop_chars must be terminated by a zero (null) byte to stop the
scan.
Example
INT count;
STRING .s[0:7] := ["ABCcDEF",0];
STRING .tar[0:3] := ["abcd",0];
count := RTL_Stcarg_(s, tar); ! count gets 3
Stccpy
The Stccpy functions copy not more than a specified number of characters from one
string to another. These functions are not available in the native CRE library.
dest
is a pointer to the destination of the copy.
source
is a pointer to the string to copy.
INT PROC RTL_Stccpy_( dest, source, max_bytes );
STRING .dest; ! out
STRING .source; ! in
INT max_bytes; ! in TNS only
INT(32) PROC RTL_StccpyX_( dest, source, max_bytes );
STRING .EXT dest; ! out
STRING .EXT source; ! in
INT(32) max_bytes; ! in TNS only