CRE Programmer's Guide
String and Memory Block Functions
Common Run-Time Environment (CRE) Programmer’s Guide—528146-004
8-28
Strtod
str
is a pointer to the string to scan.
substr
is a pointer to the substring to scan for in str.
Return Value
The Strstr functions return:
•
The address of substring within str if substr is found.
•
Zero if substr is not found within str.
Considerations
Both str and substr must be terminated by a zero (null) byte to stop the scan.
Example
STRING .s[0:17] := ["FORTUNE 500",0];
STRING .subs[0:4] := ["500",0];
STRING .subptr;
@subptr := RTL_Strstr_(s, subs); ! @subptr gets @s[8]
Strtod
The Strtod functions convert a string of characters to a 64-bit floating-point number.
str
is a pointer to the string to convert.
end_scan
is the address in str where the conversion ended. The pointer returned through
end_scan points to the first unrecognized character in str.
Return Value
The Strtod functions return the converted value.
REAL(64) PROC CRE_Strtod_( str, end_scan );
STRING .str; ! in
INT .end_scan; ! out TNS only
REAL(64) PROC CRE_StrtodX_( str, end_scan );
STRING .EXT str; ! in
INT(32) .EXT end_scan; ! out TNS only