GetVarType - method of the Pm object
Description:
Returns the data type of the value.
Syntax:
String GetVarType(Variant vValue, [Long nMode])
Parameters:
vValue | (Variant) Any valid expression. |
nMode | [optional] (Long) Specifies the level of detail of data type detection (especialy for object):
0 (default) - If the value contains object, then its type is not being detected.
|
---|
Return values:
Returns one of the following strings that specifies the data type of the value vValue:
"undefined" - The value is not set.
"null" - The value that contains no valid data.
"number" - The value je a number. The number type (integer or floating point) and byte size are not distinguished. All number types are identified the same way here. In order to detect whether it is an integer use the
Pm.IsInt method.
"boolean" - The value je a logical value
false or
true.
"string" - The value je a text string.
"vbarray" - The value je a
VBScript array.
"object" - If
nMode = 0, then the value je arbitrary object (the object type is not distinguished).
If
nMode = 1, then the value je object other than those listed objects.
"PmMap" - The value je object of the
PmMap type (only for
nMode = 1).
"PmArray" - The value je object of the
PmArray type (only for
nMode = 1).
"PmBuffer" - The value je object of the
PmBuffer type (only for
nMode = 1).
"PmForm" - The value je object of the
PmForm type (only for
nMode = 1).
"PmDateObject" - The value je object of the
PmDateObject type (only for
nMode = 1).
"PmAction" - The value je object of the
PmAction type (only for
nMode = 1).
Example1:
JavaScriptVBScriptSelect and copy to clipboard
var sType = Pm.GetVarType(-3.14);
// Returns "number"
Dim sType
sType = Pm.GetVarType(-3.14)
' Returns "number"
Example2:
JavaScriptVBScriptSelect and copy to clipboard
if (Pm.GetVarType(aArr, 1) == "PmArray")
{
var val0 = aArr.GetItem(0);
}
If Pm.GetVarType(aArr, 1) = "PmArray" Then
Dim val0
val0 = aArr(0)
End If