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

Length Of Type Function
Convert Values Class

Public Function LengthOfType( _
    ByVal vAny As Variant _
    ) As Long

Returns the length of the internal representation of any type of value.
For Empty and Null variants, returns a length of zero.
For other non-strings, the length is the number of bytes occupied by the variable.

    LengthOfType(123) = 2
    LengthOfType(123@) = 8
    LengthOfType("12345") = 5
    LengthOfType(Null) = 0
See also:
    VarTypeToLength Function
    vbArray Property, et. al.
vAny: Function returns the length of the in-memory representation of the value. Function returns 0 (zero) if vAny is an Array, Empty, Error, Null, or Variant. Function returns Null if the data type is unrecognized.
Note: If vAny is a string, this function returns the number of characters in the string (this is not necessarily the same as the length of the internal representation of the string on Unicode systems).
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.