Jump to content

Recommended Posts

Hello,

 

I have a list that is running procedures and functions all the time, based on timers. Like Load List, Do Something, Check Something, Do Next Thing....

 

How would I check when certain event happens on one line in the list. If I go through debugging it would be a night mare to go through 100s of procedures just to see whats happening in 1 line of list. I'd need some kind of event listener or something that would be triggered only when certain conditions are met or certain action happens on the list. To log events that happen after that. How would I make such an event listener. However this is not event listener based on component - like click or something. But when certain data would come into the list or when certain time would come when process would jump to specific line in the list.

Share this post


Link to post

Something like this. But this is debugger. Exceptions catcher. I mean like this.

 

Lets say you have a music player.

 

Rihanna - Only Girl.mp3

MichelJackson - Baby Jane.mp3

Prince - 1999.mp3

 

I start playing the list. I set up alarm, I say after 3 minutes no matter what you play start playing track 2 - Micheal Jackson. I want to know which procedures, functions are triggered/called when this happens. I need to know which procedures/functions program calls when it starts playing track 2 on timer.

 

Share this post


Link to post

So I need to have some kind of event catcher. That would be triggered only when something happens. Not all the time, otherwise I'd have a tracking list looking like this

 

Rihanna - Only Girl.mp3

Rihanna - Only Girl.mp3

Rihanna - Only Girl.mp3

Share this post


Link to post

You can set a breakpoint in all possible methods and enter the Condition triggering it. In the Advanced view you can disable Break and set a Log message. This won't interrupt your debugging session and you can see the messages in the event log

Share this post


Link to post

There is an option with DebugView (https://learn.microsoft.com/en-us/sysinternals/downloads/debugview)

by adding debuglog.add('ProcedurenName'); to every function/procedure and checking what is executed. However this debugview log becomes saturated with junk because the program repeatedly calls certain procedures and functions all the time when the track mp3 is playing. This info I don't need. I just need the info which procedure is called exactly when timer is triggered to play track 2. Not before not after.

Share this post


Link to post
4 minutes ago, Uwe Raabe said:

You can set a breakpoint in all possible methods and enter the Condition triggering it. In the Advanced view you can disable Break and set a Log message. This won't interrupt your debugging session and you can see the messages in the event log

Uwe you are always full of good ideas. Yes this possible methods are many. A few 10. The condition I don't know exactly, if I'd know the triggering condition I'd know where to find the right procedure. That is the catch. I need to know what is triggering the procedures that are executed on timer Track 2 and which methods are triggered.

 

Edited by direktor05

Share this post


Link to post
Just now, direktor05 said:

I just need the info which procedure is called exactly when timer is triggered to play track 2. Not before not after.

Extending my suggestion above, you can achieve this by creating a Group for all these breakpoints. Then add another breakpoint in the timer event, disable Break and select that group in Enable group. Add a similar breakpoint setting Disable group when you want to stop the log messages.

Share this post


Link to post
Just now, Uwe Raabe said:

Extending my suggestion above, you can achieve this by creating a Group for all these breakpoints. Then add another breakpoint in the timer event, disable Break and select that group in Enable group. Add a similar breakpoint setting Disable group when you want to stop the log messages.

ok I'll try

Share this post


Link to post

your reference to 'debugview' makes it look like you are also after a logging framework. On getit, there are some options. Using a  debugger is great for fault finding, but logging will help with a running app. Using a logging framework, you can decide when you want to enable/disable logging.

 

If you have a console app, the poor man version is 'writeln' 😉

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×