CRE Programmer's Guide

String and Memory Block Functions
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
8-8
Stch_I
Example
INT count;
STRING .s[0:17] := ["128456xq7",0];
INT(32) d;
count := RTL_Stcd_L_(s, d); ! count gets 6, d gets 128456
Stch_I
The Stch_I functions convert a string of hexadecimal characters to an integer. These
functions are not available in the native CRE library.
str
is a pointer to the string to convert.
integer
is a pointer to the resulting integer.
Return Value
The Stch_I functions return the number of characters scanned, or zero if str does not
begin with a valid hexadecimal character.
Considerations
The end of str is defined by the location of a zero (null) byte.
The Stch_I functions do not skip leading white space.
The Stch_I functions stop scanning if they encounter a non-hexadecimal character.
Example
INT count;
STRING .s[0:7] := ["1a2xy",0];
INT i;
count := RTL_Stch_I_(s, i); ! count gets 3, i gets 418.
INT PROC RTL_Stch_I_( str, integer );
STRING .str; ! in
INT .integer; ! out TNS only
INT PROC RTL_Stch_IX_( str, integer );
STRING .EXT str; ! in
INT .EXT integer; ! out TNS only