GetPar - method of the PmgObject object
Reading the value of the Pmg object parameter
. If the parameter is not present in this object, then the parents of the object are searched for it and if not found the search continues up to the PmgRoot
Variant GetPar(String sPar, [Long nAttr])
|sPar||(String) The name of the parameter (case sensitive text).|
| nAttr||[optional] (Long) Additional attributes for detecting parameter.|
0 (default) - Return values is of the String type.
- Return values is of the Long
If the value cannot be converted into an integer then the method returns NaN value - it can be tested by the Pm.IsValid method.
Returns a value of the parameter.
The parameter can be read:
- in the script by the GetPar method
Both approaches read parameter the cascade way (bubbling), i.e. if the object (in which the macro is used), does not have this parameter, then this parameter is searched in its parents (in the immersed object) and finally it is searched in the PmgRoot object.
The method is functional also for Web panels
Reading the value of the abc parameter. This parameter can be defined in the Pmg object oItem or in its parents.
var oItem = pMe.Items("/Panel0");
var x = oItem.GetPar("abc");
: (Revision 1) Fixed bug:
Parameter evaluation in embedded graphic objects
: Generalization by the nAttr
parameter. Now it is possible to enter that the method returns the value as Long
data type (otherwise always returned String