Public Function FixUpVariantToBooleanMaybeFn( _ ByRef rArgument As Variant _ ) As Boolean
FixUpVariantToBooleanMandFn Function FixUpVariantToBooleanMaybeSub SubroutinerArgument: Argument that is checked for compatibility with the Boolean data type. Argument will actually be converted to a Boolean value if it is a numeric string or date/time string. Function returns True if conversion is possible or was completed. Function returns False if conversion is not possible, such as when the argument is out-of-range, missing, Null, an error, a pointer, or a non-numeric string.
Example #1:
Assuming Dim varFlag As Variant varFlag = "0" for example FixUpVariantToBooleanMaybeFn(varFlag) = True leaves varFlag = False VarType(varFlag) = vbBooleanExample #2:
Assuming Dim varFlag2 As Variant varFlag2 = 0 for example FixUpVariantToBooleanMaybeFn(varFlag2) = True leaves varFlag2 = 0 VarType(varFlag) = vbInteger
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.