![background image](http://html1.mh-extra.com/html/omron/ns-runtime-software/ns-runtime-software_user-manual_744233077.webp)
4-5 Macros
4-21
STRCMP(W),
STRICMP(W)
String Comparison
Applicable versions
System Version 6.6 or higher
Format
STRCMP(S1,S2) STRICMP(S1,S2) --- ASCII code
STRCMPW(S1,S2) STRICMPW(S1,S2)
--- Unicode
Function
Compares the string.
STRCMP(W) Case sensitive
STRICMP(W) Not case sensitive
Return Value
0: Agree
-1: Disagree. Character code S1 is smaller than character code S2.
1:
Disagree. Character code S1 is greater than character code S2.
Example
STRCPY($W0, "ABC"); 'Set ABC to $W0 to $W1.
$W10= STRCMP($W0, "DEF"); 'Compare ABC and DEF. Character code
A, 0 x 41 < Character code D, 0 x 44. Thus the return value , -1, is stored in
$W0.
STRLEFT(W)
Extracts the specified number of characters from leftmost characters
of a string
Applicable versions
System Version 6.6 or higher
Format
STRLEFT(D,S,n), --- ASCII code
STRLEFTW(D,S,n) --- Unicode
Function
Stores n characters from the left of the string S to D.
Return Value
None
Example STRLEFT($W0,"ABCDEFG",3);
'Extract 3 characters (ABC) from the leftmost string and store ABC in $W0
and $W1.
STRLEN(W)
Gets string length
Applicable versions
System Version 6.6 or higher
Format
STRLEN(S)
--- ASCII code
STRLENW(S) --- Unicode
Function
Returns the length of the string S (The number of bytes of S).
Return Value
String Length (The number of bytes of S).
Example
STRCPY($W0, "ABC");
$W10 = STRLEN($W0);
‘Set 3 to '$W10
STRLTRIM(W)
Deletes the leftmost spaces of a string
Applicable versions
System Version 6.6 or higher
Format
STRLTRIM(D,S) --- ASCII code
STRLTRIMW(D,S) --- Unicode
Function
Deletes the leftmost space of the string S to enter it to D.
Return Value
None
Example
STRLTRIM($W0, " ABC");
’Store ABC in $W0 to $W1.
Содержание NS-RUNTIME - SOFTWARE
Страница 1: ...NS Runtime Software USER S MANUAL Cat No V093 E1 04...
Страница 2: ......
Страница 28: ...1 4 Comparison between the NS Series and the NS Runtime 1 14...
Страница 38: ...2 6 User Interface 2 10...
Страница 56: ...3 5 Converting Projects 3 18...
Страница 84: ...4 5 Macros 4 28...
Страница 136: ...5 11 Window Size 5 52...
Страница 154: ...7 3 Error Messages and Countermeasures 7 6...
Страница 156: ......
Страница 157: ......