I don't know of any easy way to do this. This basic does not have any real sense of strings as variable types. That is, there are no length fields associated with them nor are there any defined termination characters. What strings are is simply an array of bytes.
I have played with this some in the past and if I am simply looking for short strings I end up doing something like:
if (MyString(0)="1") and (MyString(1)="2") ...
or if I am working with lots of strings or the like I do create subroutines for them. I would then setup my search strings as byte tables. As part of this I would define some standard way I am using the strings. Either my input string is assumed to have some trailing character. I would use that approach if I am for example looking for commands that were input from a terminal with commands like:
Code:
fEqual var byte
CMD1 bytetable 4,"CMD1" ; approach if you wish to have first character be length
CMD2 bytetyable "CMD1",0 ; Approach if you wish to have trailing character to mark end
mystring var byte(80)
serin s_in, i9600, [MyString\80\13]
gosub StringComp[&mystring, 80, &cmd1], fEqual
...
p1 var pointer
cnt var byte
p2 var pointer
f var byte
StrComp[p1, cnt, p2]:
... ; do code to find out if strings are equal...
return f ; returns equality...
I would know that my string was up to 80 characters long and if it terminates early it has a value of 13 in the last byte...
I did not write the code above to do the actual compare, it would depend on what approach you use to define your search strings. I passed in pointers as it makes the code flexible to reuse to compare different strings. You could also change this, to have a byte table that defined all of the strings you wish to compare against and have the function return an index number... If I were writing the string compare function I would probably do it using inline assembly language... But that is just me

Kurt