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

Coerce To Byte Function
Coerce Make Class

Public Function CoerceToByte( _
    ByVal vString As Variant _
    ) As Variant

"Coerce String To Byte"
Return the Byte value whose in-memory representation is the same as the first character in string vString.
Inverse of the MakeByte function.

    CoerceToByte(Chr$(0)) = 0
    CoerceToByte(Chr$(1)) = 1
    CoerceToByte(Chr$(255)) = 255
    IsNull(CoerceToByte(Null)) = True
See also:
    CoerceToByteFast Function
    MakeByte Function
    CoerceToVarType Function
vString: The string whose first character is to be interpreted as a Byte value. Function returns Null if vString is Null or cannot be fixed up to a String.

Note: Function generates the Visual Basic Error "Illegal Function Call" if vString is an empty string.
Note: If vString if more than one character long, the only the first character is used.

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