Previous PageNext Page

8.4.73 StrComp Function

Returns a value indicating the result of a string comparison.
 

Syntax

StrComp(string1, string2[, compare])

Arguments

string1
Any valid string expression. Required.
string2
Any valid string expression. Required.
compare
The numeric value indicating the kind of comparison to use when evaluating strings. If omitted, a binary comparison is performed. See Settings section for values. Optional.

Settings

The compare argument can have the following values:
 

Constant Value Description
vbBinaryCompare
 
0
 
Perform a binary comparison.
 
vbTextCompare
 
1
 
Perform a textual comparison.
 

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
 
string1 or string2 is Null
 
Null
 


Copyright © 2000 Chili!Soft

Previous PageTop Of PageNext Page