Promotic
WikipediaLinkedInYoutubeTwitterFacebook

ItemEx - property of object PmOpcClientData

Description:
The property enables an access to the object of Var type that represents one variable defined on the page Data. The variable is there defined by the index parameter..
Syntax:
ItemEx(index As Variant, [nAttr As Long]) As Object
Calling:
Reading the value:
val = oOpcData.ItemEx(index).Value
Writing the value:
oOpcData.ItemEx(index).Value = val
Parameters:
index(Variant) Identification of the variable either by its name (String data type, case sensitive text, for example "a1") or by the 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:
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, which 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 does'nt exist, Nothing value is returned. Nothing value can be tested by VBScript Is operator.

See also:
Example:
Testing whether the data item named "Temperature3" exists:
If oOpcData.ItemEx("Temperature3", 1) Is Nothing Then
  ' ... error
End If
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice