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

Var Type To Length Function
Comparisons Class

Public Function VarTypeToLength( _
    ByVal vVarType As Variant _
    ) As Variant

Returns the number of bytes occupied by variables whose VarType is vVarType.

    VarTypeToLength(VarType(34%)) = 2
    VarTypeToLength(VarType(34.5!)) = 4
    VarTypeToLength(VarType("A string.")) = 0 ' #3
See also:
    LengthOfType Function
    VarTypeToString Function
    vbArray Property, et. al.
    VarType Function (Visual Basic)
vVarType: The numeric constant which represents a specific Visual Basic data type.
Return value: Function returns Null if vVarType is Null or cannot be fixed up to a number. Function returns Null if vVarType does not represent the VarType value of a Visual Basic data type. Function returns 0 (zero) if vVarType represents a variable-length data type or an array of some data type as in example #3.
v1.5 Change: This function has been extended to support the new Decimal data type in VB 6.0.

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