Skip to content
Home ยป VB 6 – StrComp()

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()
    Ouput – String Handling -StrComp()