GetOwnedByType - method of the PmaObject object
Description:
Returns an array of references to the subobjects of the defined type in the Pma object tree.
Syntax:
Array GetOwnedByType(String sClass, Long nMode)
Parameters:
sClass | (String) The name of the object type. For example "PmaPanel". |
nMode | (Long) Range of the required subobjects.
0 - subobjects only on the first nesting level
1 - subobjects on all nesting level |
---|
Return value:
1-dimensional array of values (
PmArray object for
JavaScript or
Array data type for
VBScript).
Example:
Obtains an array of references to all
PmaPanel objects in the whole tree on all levels and the iteration by this array
JavaScriptVBScriptSelect and copy to clipboard
var aObj = pMe.Pm("/").GetOwnedByType("PmaPanel", 1);
var nObj = aObj.GetSize(1);
var iObj;
for (iObj = 0; iObj < nObj; iObj++)
{
var oObj = aObj.GetItem(iObj);
// Pma object
Pm.Debug(oObj.Name);
}
Dim aObj, nObj, iObj
aObj = pMe.Pm("/").GetOwnedByType("PmaPanel", 1)
nObj = UBound(aObj) + 1
For iObj = 0 To nObj - 1
Dim oObj
Set oObj = aObj(iObj)
' Pma object
Pm.Debug oObj.Name
Next
History:
Pm8.02.15:
Fixed bug: The method returned also the object over which the method was called.