Promotic
WikipediaLinkedInYoutubeTwitterFacebook

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.
1 - If the value contains object, then it is detected whether it is one of the following Pma objects: PmMap, PmArray, PmBuffer, PmDateObject, PmAction or PmForm.
Return values:
Returns one of the following strings that specifies the data type of the value vValue:
"undefined" - The value is not set.
"number" - The value is 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 is a logical value false or true.
"string" - The value is a text string.
"vbarray" - The value is a VBScript array.
"object" - If nMode = 0, then the value contains arbitrary object (the object type is not distinguished).

If nMode = 1, then the value contains object other than those listed objects.

"PmMap" - The value is object of the PmMap type (only for nMode = 1).
"PmArray" - The value is object of the PmArray type (only for nMode = 1).
"PmBuffer" - The value is object of the PmBuffer type (only for nMode = 1).
"PmForm" - The value is object of the PmForm type (only for nMode = 1).
"PmDateObject" - The value is object of the PmDateObject type (only for nMode = 1).
"PmAction" - The value is object of the PmAction type (only for nMode = 1).
Note:

This method is functional also in Macro expression $.expr and in the onDraw event of the PmgCanvas object.

This method is also functional in Web panels.

Example1:
JavaScriptVBScriptSelect and copy to clipboard

var sType = Pm.GetVarType(-3.14);  //Returns "number"
Example2:
JavaScriptVBScriptSelect and copy to clipboard

if (Pm.GetVarType(aArr, 1) == "PmArray")
var val0 = aArr.GetItem(0);

History:
Pm8.03.13: New nMode parameter
Pm8.02.01: Created
PROMOTIC 9.0.15 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- GetVarType
 
 
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice