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

Make Long Function
Coerce Make Class

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

"Make String From Long" or "Coerce Long To String"
Coerce a Long (integer) value into a 4-character string.
Return a four-character string containing the in-memory representation of the Long value vValue.
Similar to coercing a long integer value into character string in the C language.
Same as the MKL function in earlier versions of Microsoft Basic.
Inverse of the CoerceToLong function.

    MakeLong(0) = String$(4, 0)
    MakeLong(1) = Chr$(1) + String$(3, 0)
    MakeLong(2) = Chr$(2) + String$(3, 0)
    MakeLong(2.7) = Chr$(3) + String$(3, 0)
    MakeLong(256) = Chr$(0) + Chr$(1) + Chr$(0) + Chr$(0)
    MakeLong(123456789) = Chr$(21) + Chr$(205) + Chr$(91) + Chr$(7)
    MakeLong(-1) = String$(4, 255)
    MakeLong("2") = Chr$(2) + String$(3, 0)
    IsNull(MakeLong(Null)) = True
See also:
    MakeLongFast Function
    CoerceToLong Function
    MakeInteger Function
    LOWORD Function
    HIWORD Function
vValue: The Long (integer) 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.

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.

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