|
Posted by Oli Filth on 10/03/12 11:31
Arnold McDonald said the following on 07/11/2005 15:51:
> Hi.
>
> My question is simple.
>
> Say there is a function called a(). It calls a function named b(). Inside
> b() I wanna know the name of the callee, that is a(). How to do that? Sure I
> can send the name of a() as a parameter, but is tehre any way to know the
> callee name, source, parent, etc?
(BTW, you mean "caller". "Callee" is the thing that gets called.)
It's basically not possible.
There are some convoluted methods that people have come up with that
involve dynamically re-parsing the whole script file and deducing where
it must have been called from, but that's just stupid. Anyway, who's to
say that the function call was from inside another function?
Why would you want to know where a function's being called from, anyway?
--
Oli
Navigation:
[Reply to this message]
|