r = CompareStr(s1$, s2$[, casesen, encoding])
s1$
and s2$
and returns how the two strings are related.
If s1$
is lexically less than s2$
, -1 is returned. If s1$
is lexically greater than
s2$
, 1 is returned, otherwise, i.e. if the strings are equal, the return value is 0.
The optional argument casesen
can be used to specify whether or not the
strings should be compared in a case-sensitive manner. This defaults to the
global case sensitive default mode set using IgnoreCase(). See IgnoreCase for details.
The optional encoding
parameter can be used to set the character encoding
to use. This defaults to the default string encoding set using SetDefaultEncoding().
See Character encodings for details.
True
for a case-sensitive comparison, otherwise FALSE;
the default is True
or whatever default has been set using the IgnoreCase() commandDebugPrint(CompareStr("z", "a"))The code above prints 1 because "z" is lexically greater than "a".