|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a string that provides Variant subtype information about a variable.
TypeName(varname)
varname
A required argument can be any variable.
The TypeName function has the following return values:
|
Value |
Description |
|
Byte |
Byte value |
|
Integer |
Integer value |
|
Long |
Long integer value |
|
Single |
Single-precision floating-point value |
|
Double |
Double-precision floating-point value |
|
Currency |
Currency value |
|
Decimal |
Decimal value |
|
Date |
Date or time value |
|
String |
Character string value |
|
Boolean |
Boolean value; True or False |
|
Empty |
Uninitialized |
|
Null |
No valid data |
|
<ltobject type> |
Actual type name of an object |
|
Object |
Generic object |
|
Unknown |
Unknown object type |
|
Nothing |
Object variable that has been explicitly set to Nothing, or has been set to return the value of a function that returned Nothing |
|
Error |
Error |
|
Variant() |
A Variant array |
The following example uses the TypeName function to return information about a variable:
Dim ArrayVar(4), MyType
NullVar = Null ' Assign Null value.
MyType = TypeName("VBScript") ' Returns "String".
MyType = TypeName(4) ' Returns "Integer".
MyType = TypeName(37.50) ' Returns "Double".
MyType = TypeName(NullVar) ' Returns "Null".
MyType = TypeName(ArrayVar) ' Returns "Variant()".
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.