[Gambas-user] Knowing which Module called a function in other Module
Bruce
bbruen at ...2308...
Tue Sep 3 10:12:41 CEST 2013
On Tue, 2013-09-03 at 08:53 +0100, Ru Vuott wrote:
> Hello,
>
> a Gambas-it comunity member wrote this theoric question:
>
> there are 2 Modules A & B. "A" Module calls a function in "B" Module.
>
> He would like to know if it is possible to know - without simplifications - the name of "A" Module "Caller".
>
> Another example:
> Imagine having three modules: A, B and C. Two (A and B) of these three modules can call a function present in the third "C" module. When this function is called in the third "C" Module, as you know - WITHOUT passing, as argument, explicitly trace of itself - which of the two ("A" or "B") Modules called function of the third "C" Module ?
>
> Regards
> vuott
If I haven't misunderstood, doesn't
System.Backtrace[1]
provide exactly that?
But, note that the project will need to be compiled with "Keep debugging
information" option set.
hth
Bruce
More information about the User
mailing list