System.CallDepth - Manhunter07/MFL GitHub Wiki
Declaration
function CallDepth: System.PosInt = \built-in\
Description
The CallDepth function in the System package returns the current outside-itself function call depth at the moment of evaluation. It is 0 if called from outside a function and 1 or greater if called from inside. Each object from the call stack is added into the returned number with the exception of the CallDepth function itself which is left out.
Remarks
- The result of this function is identical to the expression
Length(CallStack) CallDepthdoes not count the call to itself for its result value- You may use the
Callerfunction helper to get the caller function (orNil) of the current function