Option Compare statement (LotusScript® Language)

Specifies the method of string comparison.

Syntax

Option Compare option1 [ , option2 ]

Elements

Option can be any of the following:

Binary

Comparison is bit-wise. If Binary is specified, no other option can be specified.

Case or NoCase

Comparison is case sensitive (default) or case insensitive. Only one of these options can be specified. The keyword Text is acceptable in place of NoCase.

Pitch or NoPitch

Comparison is pitch sensitive (default) or pitch insensitive. Only one of these options can be specified. These options apply to Asian (double byte) characters.

Usage

The Case, NoCase, Pitch, and NoPitch keywords specify string comparison using the character collation sequence determined by the HCL software that you are using. The Binary keyword specifies string comparison in the platform's collation sequence: the effect is platform sort-order, case-sensitive, pitch-sensitive comparison.

Option Compare can be specified more than once per module, but the options cannot conflict. Option Compare can appear anywhere at module level. Option Compare applies to all string comparisons in the module. If you omit the Option Compare statement, the default method of string comparison is the same as Option Compare Case and Option Compare Pitch.

In certain functions such as InStr and StrCompare, the case and pitch sensitivity established by Option Compare or by default can be overridden by case-sensitivity and pitch-sensitivity arguments.

Example