aaronk Well-Known Member Licensed User Longtime User Dec 20, 2013 #1 Hello, I have a sub which has some code in it and many other subs can call and trigger code in that sub. Is there a way to log which sub called another sub? For Example: In a activity I have.. Main: Code: Copy Sub run_me ' some code here End Sub Sub Trigger_1 run_me ' trigger the run_me sub End Sub Sub Trigger_2 run_me ' trigger the run_me sub End Sub Is there a way to find out which sub called the run_me sub ? (Trigger_1 or Trigger_2) I have many subs that trigger a sub and I need to work out which sub actually triggers the sub. I understand I can just put Log("Sub x") at the start of the code to find out but there are many subs and it will take to long to put all the logs in the app just to find the one sub I am looking for. Hoping there is a easy way to find out before I begin writing log in front of all the code that triggers the sub and then having to remove them all afterwards.
Hello, I have a sub which has some code in it and many other subs can call and trigger code in that sub. Is there a way to log which sub called another sub? For Example: In a activity I have.. Main: Code: Copy Sub run_me ' some code here End Sub Sub Trigger_1 run_me ' trigger the run_me sub End Sub Sub Trigger_2 run_me ' trigger the run_me sub End Sub Is there a way to find out which sub called the run_me sub ? (Trigger_1 or Trigger_2) I have many subs that trigger a sub and I need to work out which sub actually triggers the sub. I understand I can just put Log("Sub x") at the start of the code to find out but there are many subs and it will take to long to put all the logs in the app just to find the one sub I am looking for. Hoping there is a easy way to find out before I begin writing log in front of all the code that triggers the sub and then having to remove them all afterwards.
Erel B4X founder Staff member Licensed User Longtime User Dec 20, 2013 #2 If you are using the debugger then you can put a breakpoint in this sub and then see the Subs Stack list. Upvote 0
If you are using the debugger then you can put a breakpoint in this sub and then see the Subs Stack list.
DonManfred Expert Licensed User Longtime User Dec 20, 2013 #3 you can give the subname as parameter to "run_me" Upvote 0