Developer Documentation Library > UNICOM Intelligence Function Library > Miscellaneous functions > VarType
 
VarType
Returns a numeric value indicating the type of a variable.
Syntax
VarType(<value>)
Parameters
<value>
Type: Long
The data value.
(return)
Type: Long
The type of <value>.
Notes
The return value is a number representing the type of <value>.
Value
Type of Val
0
None (<value> is NULL)
1
Long
2
Text
3
Categorical
4
Object
5
Date
6
Double
7
Boolean
An error occurs if <value> has any other type.
This function is similar to the VarType function in Visual Basic.
Example
The following mrScriptBasic example uses the VarType function to determine the type of a variable:
Dim MyVar, MyTest

MyVar = 34
MyTest = VarType(MyVar) ' Returns 1

MyVar = "Hullo"
MyTest = VarType(MyVar) ' Returns 2

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