<-- Previous || Up || Next -->

Fix Up Variant To Boolean Maybe Fn Function
Fix Ups Class

Public Function FixUpVariantToBooleanMaybeFn( _
    ByRef rArgument As Variant _
    ) As Boolean

"Fix Up Variant To Boolean Maybe Function"
Return True if rArgument can be converted to a Boolean value.
Return False otherwise.
Numeric strings are converted into Boolean values,
date/time strings are converted into Date values,
and other values are left as-is.

See also:
    FixUpVariantToBooleanMandFn Function
    FixUpVariantToBooleanMaybeSub Subroutine
rArgument: 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.
Note: rArgument is a passed by reference, so the variable passed from the calling function may be modified.

Example #1:

       Dim varFlag As Variant
       varFlag = "0"
    for example
       FixUpVariantToBooleanMaybeFn(varFlag) = True
       varFlag = False
       VarType(varFlag) = vbBoolean
Example #2:
       Dim varFlag2 As Variant
       varFlag2 = 0
    for example
       FixUpVariantToBooleanMaybeFn(varFlag2) = True
       varFlag2 = 0
       VarType(varFlag) = vbInteger

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.