sPath | (String) Relative or absolute path to the Pmg object or its implementation subobject (case sensitive text).
The path describes the location of the object in the tree structure of the immersed Pmg objects. Each tree level adress is separated by the / character. The immersed Pmg object is referenced by its name. The superior Pmg object is referenced by .. characters. The absolute path starts with the / character and describes the path to the Pmg object from beginning of the tree structure. The relative path starts with the name of the immersed Pmg object or by reference to superior Pmg object by .. characters, or by reference to itself ., describes the path to another Pmg object relative to itself. The immersed implementation subobject (other than PmgObject type) is referrenced by # character, followed by the implementation subobject type definition (e.g. #vars). It means that the # addressing leaves the panel Pmg objects tree and starts to address the implementation subobjects. For example "/text0/#vars/Temperature". #vars - Enables the variables of the Pmg object.
The variable of the Pmg object can be reached by two ways: 1) From the Pmg object by the Vars method. For example
pMe.Items("/text0").Vars("Temperature").Value 2) By setting the path to the Pmg object extended by access to implementation object by #vars. For example pMe.Items("/text0/#vars/Temperature").Value
Note! The way of entering the path down to the specific variable of the Pmg object can be used in the PmgObject.Items method, in the "GP - Pmg object property" data binding and also in #pragma variable x = PmgObjectRef("path"). |
---|---|
nAttr | [optional] (Long) It allows to change the behavior of the method.
0 (default) - Default behavior.
1 - When referencing the non-existing object, the global error of the INFO system will not be generated. |
pMe.Items("../text0").Visible = 0;
var oBox = pMe.Items("/Box");
var oBar0 = oBox.Items("Bar0");
oBar0.Value = 100;
// Writing the 0 value into the "Temperature" variable of the Pmg object "text0" immersed into the parent object named "box0". The reference to the object is absolute.
pMe.Items("/box0/text0/#vars/Temperature").Value = 0;
// Writing the 0 value into the "Temperature" variable in my own Pmg object. The reference to the object is relative.
pMe.Items("./#vars/Temperature").Value = 0;
// Writing the 0 value into the "Temperature" variable in superior Pmg object. The reference to the object is relative.
pMe.Items("../#vars/Temperature").Value = 0;
// Writing the 0 value into the "Temperature" variable of the Pmg object "text1" immersed into my superior Pmg object. The reference to the object is relative.
pMe.Items("../text1/#vars/Temperature").Value = 0;
var oBar0 = pMe.Items("/Box/Bar0");
var oBar1 = oBar0.Items("../Bar1");
oBar1.Value = 100;