Function Coerce Make Class

MakeBoolean

"Make String From Boolean" or "Coerce Boolean To String" Coerce a Boolean value into a 2-character string. Return the two-character string whose bytes have the same in-memory representation as the Boolean value vValue.

Signature (Visual Basic / VBA)

Public Function MakeBoolean( _
    ByVal vValue As Variant _
    ) As Variant

Code Example

    MakeBoolean(True) = Chr$(255) + Chr$(255)
    MakeBoolean(False) = Chr$(0) + Chr$(0)
    MakeBoolean(1234) = Chr$(255) + Chr$(255)
    MakeBoolean(0) = Chr$(0) + Chr$(0)
    IsNull(MakeBoolean(Null)) = True

Parameters

Parameter Description
vValue The Boolean value whose bytes are to be interpreted as a string. vValue can be a numeric value, a date value, a numeric string, or a date string. Function returns Null if vValue is Null. Function returns an empty string if vValue cannot be fixed up to a number.

Notes & Version History

Note This function converts the string representation of the value to Unicode using the default code page of the system.
v1.3 Change Removed 16-bit support from this function.