StrComp$ Function
Syntax
Group
Description
Compare two strings.
Parameters |
Description |
Compare this string with Str2. If this value is Null then Null is returned. |
|
Compare this string with Str1. If this value is Null then Null is returned. |
|
This numeric value indicates the type of comparison. See Comp table below. |
Result |
Description |
-1 |
|
0 |
|
1 |
|
Comp |
Value |
Effect |
vbUseCompareOption |
-1 |
Performs the comparison using the Option Compare statement value. |
vbBinaryCompare |
0 |
Compares the string's binary data. |
vbTextCompare |
1 |
Compares the string's text using the collation rules. |
vbDatabaseCompare |
2 |
Microsoft Access only. (Not supported.) |
See Also
LCase$( ), Option Compare, StrConv$( ), UCase$( )
Example
Sub Main
Debug.Print StrComp("F","e") ' -1
Debug.Print StrComp("F","e",1) ' 1
Debug.Print StrComp("F","f",1) ' 0
End Sub