Promotic
WikipediaLinkedInYoutubeTwitterFacebook

ItemEx - method of object PmTrend

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:
Writing the value:
oTrend.ItemEx(id).Value = val
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[optional] (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:

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.

This method enables access only to variables (with corresponding data extension) that are created directly in this object (own variables). In fact also other variables from PmData objects are registered into this object - those that have corresponding data extension configured with path to this object. All data extensions registered in this object can be accessed by method GetVarExtensions.

See also:
Example:
Testing whether the variable named "Temperature3" exists:
VBScriptSelect and copy to clipboard

Dim oItem
Set oItem = oTrend.ItemEx("Temperature3", 1)
If oItem Is Nothing Then
  '... error
End If
PROMOTIC 9.0.0 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