Jorge M A Well-Known Member Licensed User Longtime User Dec 12, 2019 #1 Hello Experts! The title refers to this attractive code written by @stevel05, Log Stack Trace, but I don't understand how to use it. The problem I'm trying to solve is that one of my subs is being invoked multiple times and I can't find it from where. My code is a bit complex and previously have to deal with some Sleep()s for refreshing screen elements. Can someone show me how to use it and what parameters to set?
Hello Experts! The title refers to this attractive code written by @stevel05, Log Stack Trace, but I don't understand how to use it. The problem I'm trying to solve is that one of my subs is being invoked multiple times and I can't find it from where. My code is a bit complex and previously have to deal with some Sleep()s for refreshing screen elements. Can someone show me how to use it and what parameters to set?
stevel05 Expert Licensed User Longtime User Dec 12, 2019 #2 As you are only interested in one sub, put the call as the first line in the sub and pass the Subname, set the limit to -1, this will log the whole stacktrace, you can limit it to as much as needed so you can see the information you want if there are too many items in the log. This should show you where the call to the sub came from: Code: Sub SubtoTrace LogStackTrace("SubtoTrace",-1) .'Other code . . End Sub The first line of the stacktrace should show you the sub it was called from. Last edited: Dec 12, 2019 Upvote 0
As you are only interested in one sub, put the call as the first line in the sub and pass the Subname, set the limit to -1, this will log the whole stacktrace, you can limit it to as much as needed so you can see the information you want if there are too many items in the log. This should show you where the call to the sub came from: Code: Sub SubtoTrace LogStackTrace("SubtoTrace",-1) .'Other code . . End Sub The first line of the stacktrace should show you the sub it was called from.
Jorge M A Well-Known Member Licensed User Longtime User Dec 12, 2019 #3 Thank you @stevel05 !! For this, and all good stuff you share! Upvote 0