StrComp Function
Compara dúas cadeas e devolve un valor enteiro que representa o resultado da comparación.
Sintaxe:
StrComp (Texto1 As String, Texto2 As String[, Comparación])
Valor de retorno:
Enteiro
Parámetro:
Text1: Any string expression
Text2: Any string expression
Compare: This optional parameter sets the comparison method. If Compare = 1, the string comparison is case-sensitive. If Compare = 0, no distinction is made between uppercase and lowercase letters.
Return value
-
Se Texto1 < Texto2 a función devolve -1
-
Se Texto1 = Texto2 a función devolve 0
-
Se Texto1 > Texto2 a función devolve 1
Exemplo:
Sub ExampleStrComp
Dim iVar As Single
Dim sVar As String
iVar = 123.123
sVar = Str$(iVar)
MsgBox strcomp(sVar , Str$(iVar),1)
End Sub