|
|
Joined: Dec 1999
Posts: 30,867
Master Elite Member
|
Private Function isValidBool(TestValue As Boolean) As Boolean
'Purpose
' Used to determine if a specified string is a valid boolean.
'Parameters
' TestValue (String) = The string we're testing.
'Return (Boolean)
' Returns True if the specified value can be converted to a boolean.
' Returns False if the specified value can not be converted to a boolean.
'Version History
' 1.0 6/15/2006 7:09am Tested by Russ Tanner on VB6 Win2000
'---
'Initiate variables
Dim X As Double 'buffer
'Arm the error handler
On Error Resume Next
Err.Clear
'Test the value
X = CBool(TestValue)
'Return True if an error occured, False otherwise
isValidBool = IIf(Err.Number = 0, True, False)
'Disarm the error handler
On Error GoTo 0
End Function
|
|
|
|
|