Promotic
WikipediaLinkedInYoutubeTwitterFacebook

ItemEx - property of object PmData

Description:
The property enables an access to the object of Var type that represents one variable defined on the page Data.
Syntax:
ItemEx(id As Variant, nAttr As Long) As Object
Calling:
Reading the value:
val = oData.ItemEx(id).Value
Writing the value:
oData.ItemEx(id).Value = val
Access to the object that represents the variable:
Set obj = oData.ItemEx(id)
Parameters:
id(Variant) Specifies the variable either by its name (String data type, case sensitive text, for example "a1") or by index (zero-based index).
nAttr(Long) Enables to change the behavior of the method.
0 (default) - default behavior (as Item property).
1 - when referencing the non-existent variable the global error in the INFO system won't be generated.
Note:
Property access for read only.

The Var object includes information about the variable (value, name, index, etc.).

The Item property (like Var object) is read only, it means that the object cannot be changed but for example it is possible to write into the Value of the Var object.

If the variable doesn't exist, then Nothing value is returned. Nothing value can be tested by VBScript Is operator.

 
Identifier #vars:The reference to Var object can also be done directly by extending the path of the Pm method using the #vars identifier. This identifier can be used in methods working with application object tree (e.g. for the Pm method), or for the PP data binding in the application and in panels. For example the method Pm("/data/#vars/Temperature) returns the "Temperature" variable (Var) in the "data" object(PmData).
 
Identifier #ext: References to Data extensions objects in the Var variable can also be done directly by extending the path of the Pm method using the #ext identifier. This can be used in Pm method or in PP binding in the application and in panels. For example the pMe.Pm method ("/data/#vars/Temperature/#ext/al") returns the data extension with al identifier (ExtAlarmAnalog) in the "Temperature" variable (Var) in the "data" object (PmData).
See also:
Example:
Testing whether the variable named "Temperature3" exists:
VBScriptSelect and copy to clipboard

Dim oItem
Set oItem = oData.ItemEx("Temperature3", 1)
If oItem Is Nothing Then
  '...
End If
PROMOTIC 8.3.27 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice