Function Fix Ups Class

FixUpVariantToStringFn

"Fix Up Variant To String Function" Leave string values as-is, and convert numeric or date arguments into string values. Return True if the argument is already a string or if it was successfully converted to one. Return False otherwise.

Signature (Visual Basic / VBA)

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

Code Example

    Function Soundex(ByVal vValue As Variant) As Variant
        ' Return Null if argument vValue is Null or cannot
        ' be converted to a string.
        If Not FixUpVariantToStringFn(vValue) Then
            Soundex = Null
            Exit Function
        End If
        ' Other code here.

Parameters

Parameter Description
rArgument The argument which is converted into a string value, if possible. Function returns True if the rArgument is a string or if it can be converted to one. Function returns False if conversion was not possible, such as when the argument is missing, Null, an array, an error, or an object.

Notes & Version History

Summary Convert numeric and date arguments to their default string representation. Return False if the argument cannot be converted to a string.
Note rArgument is a passed by reference, so the variable passed from the calling function may be modified.