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

Var Type To String Function
Comparisons Class

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

"Variable Type To String"
Converts a numeric value returned by the Visual Basic VarType function into a string which names the data type.

    VarTypeToString(VarType("A string here.")) = "String"
    VarTypeToString(VarType(34.5!) = "Single"
    VarTypeToString(VarType(Null) = "Null"
    VarTypeToString(vbString) = "String"
See also:
    VarTypeFromString Function
    vbArray Property, et. al.
    VT Function
    VarTypeToLength Function
    VarType Function (Visual Basic)
vVarType: The numeric constant which represents a specific Visual Basic data type. 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.

v1.2 BugFix: Changed function to correctly recognize arrays of types other than Variant. Arrays are now identified by names like "Currency Array" or "Variant Array".
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.