VB 6 – StrComp()

The strComp() function is a string handling function that compares two given string and returns an integer value. If the strings are same, a 0 is returned and if they are different then -1 is returned.

Example Program Code: StrComp()

Private Sub Command1_Click()
Dim result As Integer


result = StrComp(Text1.Text, Text2.Text)

If result = 0 Then

Text3.Text = "True"
Else

Text3.Text = "False"
End If

End Sub

Output: StrComp()

Ouput – String Handling -StrComp()
Advertisements
Advertisements
Advertisements

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Exit mobile version