GetPar - method of the PmgObject object
Reading the value of the Pmg object parameter
If this 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 parametr name (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
Returns a value of the parameter.
If an error occures, then the method returns: null
(it can be tested by the Pm.IsValid
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 the parameter is searched in its parents (in the immersed object) and finally it is searched in the PmgRoot
The method is functional also for Web panels
Reading the value of the abc parameter. This parameter can be defined in the Pmg object oObject or in its parents.
var oObject = pMe.Items("/Panel0");
var x = oObject.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