GetChildrenList PowerScript function
Description
Provides a list of the children of a routine included in a
trace tree model.
Controls
TraceTreeObject, TraceTreeRoutine, and TraceTreeGarbageCollect
objects
Syntax
|
1 |
<span>instancename</span>.<span>GetChildrenList </span>( <span>list </span>) |
|
Argument |
Description |
|---|---|
|
instancename |
Instance name of the TraceTreeObject, |
|
list |
An unbounded array variable of datatype |
Return Values
ErrorReturn. Returns the following values:
-
Success! – The function succeeded
-
ModelNotExistsError! – The model does not
exist
Usage
You use the GetChildrenList function to
extract a list of the children of a routine (the classes and routines
it calls) included in a trace tree model. Each child listed is defined
as a TraceTreeNode object and provides the type of activity represented
by that child.
You must have previously created the trace tree model from
a trace file using the BuildModel function.
When the GetChildrenList function is called
for TraceTreeGarbageCollect objects, each child listed usually represents
the destruction of a garbage collected object.
Examples
This example checks the activity type of a node included
in the trace tree model. If the activity type is an occurrence of
a routine, it determines the name of the class that contains the
routine and provides a list of the classes and routines called by
that routine:
|
1 |
TraceTree ltct_node |
|
1 |
TraceTreeNode ltctn_list |
|
1 |
... |
|
1 |
CHOOSE CASE node.ActivityType |
|
1 |
CASE ActRoutine! |
|
1 |
TraceTreeRoutine ltctrt_rout |
|
1 |
ltctrt_rout = ltct_node |
|
1 |
|
1 |
    result += "Enter " + ltctrt_rout.ClassName & |
|
1 |
    + "." + ltctrt_rout.name + " " & |
|
1 |
    + String(ltctrt_rout.ObjectID) + " " & |
|
1 |
   + String(ltctrt_rout.EnterTimerValue) & |
|
1 |
+ "~r~n" ltctrt_rout.<span>GetChildrenList</span>(ltctn_list) |
|
1 |
... |