Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disable timers in debug mode
Message
De
15/02/2018 04:34:38
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
15/02/2018 03:13:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Divers
Thread ID:
01658113
Message ID:
01658120
Vues:
69
>>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform