You use the relational (comparison) operators =, <>, ><, <, <=,=<, >, >=, and => to ascertain the relative positionsof two strings in ASCII sort order. The result of comparing two stringsin this way is a value of True, False, or NULL (if one of the operandsis NULL). Whether the comparison is case sensitive or case insensitivedepends on the setting of the Option Compare statement in the modulein which the comparison takes place. Option Compare Case (the default)makes string comparison case sensitive; Option Compare NoCase makesstring comparison case insensitive.
You can also make string comparison case sensitive with OptionCompare Binary. This specifies that string comparison is case sensitive,and the sort order is determined by the platform and character seton which your product is running LotusScript®.
For Asian (double-byte) characters, whether the comparison is pitchsensitive or pitch insensitive depends on the setting of the OptionCompare statement in the module in which the comparison takes place.Option Compare Pitch (the default) makes string comparison pitch sensitive;Option Compare NoPitch makes string comparison pitch insensitive.
This example illustrates using of relational operators to performstring comparison. The user enters a character, which is then checkedto see if it falls in the range A-Z. If not, the character is checkedto see if it falls in the range a-z.
Option Compare BinaryDim theChar As StringtheChar$ = InputBox$("Please enter a character:")If ((theChar$ >= "A") And (theChar$ <= "Z")) Then Print "You entered an uppercase character."ElseIf ((theChar$ >= "a") And (theChar$ <= "z")) Then Print "You entered a lowercase character."Else Print "You entered a nonalphabetic character."End If