currentStack(procStack: ProcessStackArray);
The currentStack method of the Process class populates the process stack array specified in the procStack parameter with references to method call descriptor objects. The process stack array represents a snapshot of the current execution history of the application thread of the current process. For more details, see "MethodCallDesc Class".
An exception is raised if an attempt is made to call this method for a process other than the current process.
As this method creates transient instances of the MethodCallDesc class, it is the responsibility of the method caller to purge the collection used by the method to delete these transient instances. The collection should be purged before the deletion of the process stack array passed to the method in the procStack parameter.
The following example shows an
getMethodCallers();
vars
callStack : ProcessStackArray;
methCallDesc : MethodCallDesc;
begin
create callStack;
// get the stack for the current process
process.currentStack(callStack);
// iterate through the process stack array and display each
// MethodCallDesc
foreach methCallDesc in callStack do
write methCallDesc.display;
endforeach;
epilog
// before finishing, delete the transient MethodCallDesc
// objects created by the currentStack method
callStack.purge;
delete callStack;
end;