VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Determines if a variant is equivalent to either True or False.

by Kevin D. Sandal (2 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Fri 9th April 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Determines if a variant is equivalent to either True or False.

Rate Determines if a variant is equivalent to either True or False.



    
    On Error Resume Next

    Dim blnReturnVal As Boolean
    
    If IsNumeric(vntValue) Then
        blnReturnVal = (vntValue = True)
    Else
        If Not IsDate(vntValue) Then
            Dim strText As String
            strText = Trim$(UCase$(vntValue))
            If strText = "TRUE" Or strText = "1" Or strText = "YES" Then
                blnReturnVal = True
            End If
        Else
            blnReturnVal = (CInt(vntValue) = True)
        End If
    End If

    TrueOrFalse = blnReturnVal

End Function


Download this snippet    Add to My Saved Code

Determines if a variant is equivalent to either True or False. Comments

No comments have been posted about Determines if a variant is equivalent to either True or False.. Why not be the first to post a comment about Determines if a variant is equivalent to either True or False..

Post your comment

Subject:
Message:
0/1000 characters