LPC Library Functions: call_stack

NAME

call_stack() - return the stack of function calls

SYNOPSIS

mixed *call_stack(int x);

DESCRIPTION

call_stack() returns information about how the thread of execution arrived at the current point. call_stack() takes a single optional parameter 'x' which tells call_stack() what to return:

          . call_stack(), call_stack(0): an array of program names
          . call_stack(1): array of current objects (in that frame)
          . call_stack(2): array of function names
          . call_stack(3): array of what origin() returns in that frame
All the arrays are the same length; i.e. element 5 of call_stack(0) is the same frame as element 5 of call_stack(2). The following example displays the object and function from which the current function was called:
    printf("I got called from %s in %s", call_stack(2)[0],
            call_stack(0)[0]);

SEE ALSO

previous_object()
Page design by Frank Jacquette & Tim Hollebeek
Copyright (C) 1998 Tim Hollebeek & Frank Jacquette
Back to MudOS