CRE Programmer's Guide

String and Memory Block Functions
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
8-18
Strcmp
Return Value
The Strchr functions return the address of the first occurrence in str of char. If str
does not contain
char, zero is returned.
Considerations
str must be terminated by a zero (null) byte to stop the scan.
Example
STRING .s[0:100] := ["Find me",0];
STRING .char_ptr;
! @char_ptr gets @s[5]
@char_ptr := RTL_Strchr_(s, "m");
Strcmp
The Strcmp functions compare two strings.
str1
is a pointer to the first string.
str2
is a pointer to the second string.
Return Value
The Strcmp functions return a value that is
< 0 if str1 < str2
0 if str1 = str2
> 0 if str1 > str2
Considerations
Both str1 and str2 must be terminated by a zero (null) byte to stop the scan.
For less-than and greater-than comparisons, characters in str1 and str2 are
compared using the characters’ numeric values in the ASCII collating sequence.
INT PROC RTL_Strcmp_( str1, str2 );
STRING .str1; ! in
STRING .str2; ! in TNS only
INT PROC RTL_StrcmpX_( str1, str2 );
STRING .EXT str1; ! in
STRING .EXT str2; ! inv TNS only