Download TR0109 TSK3000 Embedded Tools Reference

Transcript
TSK3000 Embedded Tools Reference
@STRCMP(string1,string2)
Compares string1 with string2 by comparing the characters in the string. The function returns the
difference between the characters at the first position where they disagree, or zero when the strings are
equal:
<0
if string1 < string2
0
if string1 == string2
>0
if string1 > string2
Example:
.IF (@STRCMP(STR,'MAIN'))==0
; does STR equal 'MAIN'?
@STRLEN(string)
Returns the length of string as an integer.
Example:
SLEN SET @STRLEN('string')
; SLEN = 6
@STRPOS(string1,string2[,start])
Returns the position of string2 in string1 as an integer. If string2 does not occur in string1, the last string
postition + 1 is returned.
With start you can specify the starting position of the search. If you do not specify start, the search is
started from the beginning of string1.
Example:
ID .set @STRPOS('TASKING','ASK')
ID .set @STRPOS('TASKING','BUG')
3-4
; ID = 1
; ID = 7