Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disable timers in debug mode
Message
From
15/02/2018 04:34:38
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
15/02/2018 03:13:45
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01658113
Message ID:
01658120
Views:
70
>>I was thinking about wexists("debugger")
>>
>>I'll try your solution instead.
>
>I am not sure which is best.

This method involves code in each timer, which is not always under our control - for instance, some of Carlos's classes, or Aleksej Grigorjev... no source code, lots of protected PEMs. So I tried a different approach: go through _screen.forms, and for each I recurse (using my recurse.prg - it's here in downloads) through all of its objects, and if it's baseclass is timer, I disable it (again, doesn't always work with some of those).

Reading this I got a better idea - if I'd want to restore them when I finish debugging, I wouldn't know which ones were active. So perhaps a better idea would be to set their intervals to some insanely large value, perhaps a megasecond up, and then when restoring just remove that megasecond... like this

timer.interval = timer.interval + 1000000 && disable
timer.interval = timer.interval % 1000000 && enable

Of course, if the timer's code adjusts this.interval and that code somehow runs after this, well, see with the person who wrote it :).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform