NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

StrComp Function

Returns an Integer indicating the result of a string comparison.

StrComp(string1, string2[, compare])

Arguments

string1
Required. Any valid string expression.
string2
Required. Any valid string expression.
compare
Optional. Specifies the type of string comparison. If the compare argument is Null, an error occurs. If compare is omitted, the Option Compare setting determines the type of comparison.

Settings

The compare argument settings are:

Constant Value Description
BinaryCompare 0 Performs a binary comparison, based on a sort order derived from the internal binary representations of the characters.
TextCompare 1 Performs a textual comparison, based on a case-insensitive text sort order.

Return Values

The StrComp function has the following return values:

If StrComp returns
string1 is less than string2 -1
string1 is equal to string2 0
string1 is greater than string2 1

See Also

Example

CompareMode Property | InStr Function | Option Compare Statement