Scripting > UNICOM Intelligence Function Library > Miscellaneous functions > VarTypeName
 
VarTypeName
Returns a string indicating the type of a variable.
Syntax
VarTypeName(Val)
Parameter
Val
Type: Long
The data value.
(return)
Type: Text
The type of Val.
Remarks
The return value is a string representing the type of Val, as shown below.
Return value
Type of val
"None"
None (Val is NULL)
"Long"
Long
"Text"
Text
"Categorical"
Categorical
"Object"
Object
"Date"
Date
"Double"
Double
"Boolean"
Boolean
An error occurs if Val has any other type.
This function is similar to the TypeName function in Visual Basic.
Example
The following mrScriptBasic example uses the VarTypeName function to determine the type of a variable:
Dim MyTest, MyVar

MyVar = 34
MyTest = VarTypeName(MyVar) ' Returns "Long"

MyVar = "Hullo"
MyTest = VarTypeName(MyVar) ' Returns "Text"

MyVar = {1, 2, 3, 4}
MyTest = VarTypeName(MyVar) ' Returns "Categorical"
See also
VarType
Miscellaneous functions