by
Paul Mathews >> Thu, 8 Mar 2001 17:00:30 GMT
Similarly at times you want to know where a method has been called
from.
In that case just place previousMethod() below in that method.
The original code came from JadeSupport - Paul Daigneault (thanks Paul !).
Place the previousMethod on the Object Class.
previousMethod();
// Use for debugging, eg previousMethod; to see where a method has
been called from !
// Writes each of the Methods prior to the on you are in !
vars
callStack : ProcessStackArray;
methCallDesc : MethodCallDesc;begin
create callStack;
// get the stack for the current process
process.currentStack(callStack);
// cut back the stack to the current method
callStack.removeAt(1); // remove currentStack
callStack.removeAt(1); // remove self
foreach methCallDesc in callStack do
write methCallDesc.display();
endforeach;
epilog
// the currentStack method creates transient
// MethodCallDesc objects, so they must be deleted before
// finishing
callStack.purge;
delete callStack;
end;
Paul Mathews
pem@cmsystemsgroup.com.au
Phone: [612] (99717384) Fax[612] (99711679)
(Dee Why,Sydney,Australia)