Discovery of calling routine
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Discovery of calling routine
If I have a script and it calls a function, can the function know what script called it?
This would be very useful in debugging.
This would be very useful in debugging.
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Discovery of calling routine
Hi,
You may use "executionContexts".
Best regards
Jean-Marc
You may use "executionContexts".
Best regards
Jean-Marc
Last edited by jmburnod on Wed Jun 20, 2018 6:49 am, edited 1 time in total.
https://alternatic.ch
Re: Discovery of calling routine
Please check "ExecutionContexts" in the dictionary, I think this is what you are looking for!
Re: Discovery of calling routine
Hi
Close but not quite
Consider this
Can 'thefunction' know who called it?
Close but not quite
Consider this
Code: Select all
on Command01
put theFunction() into theAnswer
end Command01
on Command02
put theFunction() into theAnswer
end Command2
function theFunction
return ThisText
end function
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Discovery of calling routine
Hi mvillion,
What about executionContexts ?
What about executionContexts ?
Code: Select all
function theFunction
put item -2 of line -2 of the executionContexts into tHandler
return ThisText && tHandler
end function
https://alternatic.ch
Re: Discovery of calling routine
Perfect. Thanks
Re: Discovery of calling routine
You're welcome!