CRE Programmer's Guide

String and Memory Block Functions
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
8-10
Stcpm
If all digits are not stored, the digits stored are the least significant digits of the
converted integer.
Example
INT count;
STRING .s[0:7];
INT i := 17;
! count gets 2, s gets ["17",0]
count := RTL_Stci_D_(s, i, 8);
Stcpm
The Stcpm functions scan a string for the first occurrence of a substring that matches a
specified pattern. This function is not available in the native CRE library.
str
is a pointer to the string to scan.
pat
is a pointer to the pattern string. The pattern is specified using regular expression
notation:
match
is a pointer, returned by Stcpm, to the substring in str that matches pat.
Integer Negative? Max Bytes Max Digits Stored
No N N - 1
Yes N N - 2
INT PROC RTL_Stcpm_( str, pat, match );
STRING .str; ! in
STRING .pat; ! in
INT .match; ! out TNS only
INT PROC RTL_StcpmX_( str, pat, match );
STRING .EXT str; ! in
STRING .EXT pat; ! in
INT(32) .EXT match; ! out TNS only
? matches any character.
s
*
matches zero or more occurrences of
s.
s+ matches one or more occurrences of s.
s matches s.