Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disable timers in debug mode
Message
From
18/02/2018 04:16:14
 
 
To
17/02/2018 22:35:17
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:
01658196
Views:
68
Likes (1)
>>>>>The issue of timers while debugging is actually quite frustrating, when various screen candy comes with so many of them - toolbars using them to refresh, statusbar likewise, hover buttons having their own... and if you turn the debugger on, all that code executes visibly slower and you have to wait... but then it executes again because some of the timers are set to 100ms. It's a nightmare. So something like killtimers.prg is necessary, saves some nerves at times.
>>>>
>>>>With the keyboard shortcut I can disable the debugger when I forgot to before running code, and vice versa, I can still add breakpoints which then will be or won't be respected. I have also been able to escape from endless loops in some cases, but not always.
>>>
>>>Now that's something - I don't really care whether I can escape an endless loop, killing the process costs almost nothing nowadays, but being able to jump in and see when/where it happens is worth it. Just stepping through a few rounds of it would lead to a solution much faster than any other way (specially not if it happens near the end of a longer process). How did you set up that shortcut?
>>>
>>>...never mind, found it, at the very end :).
>>
>>There's a tool in the repository called "TggleDebugger.prg". Well, actually the full name is THOR_TOOL_REPOSITORY_ToggleDebugger.PRG. If you can't find me, I can post i here.
>Tore.
>would like to add that Keybord shortcut, however cant find it in my Thor Configuration screen, please advise. Moreover would this be possible to add also to the timers in Thor? I do use now this trick to disable the timer(s) in my application with visible 'debug' however I do encounter also the timers inside Thor who make it impossible to debug properly. Sofar I found best thing is to end Thor when you are in debug mode.
>Regards,
>Koen

Koen,
I don't know where I got this piece of code from, maybe I created it myself a long time ago. Anyway, here it is. Just save it in Thor\Tools as THOR_TOOL_REPOSITORY_ToggleDebugger.PRG.

Lparameters lxParam1

****************************************************************
****************************************************************
* Standard prefix for all tools for Thor, allowing this tool to
* tell Thor about itself.

If Pcount() = 1 ;
And 'O' = Vartype(m.lxParam1) ;
And 'thorinfo' == Lower(m.lxParam1.Class)

With m.lxParam1

* Required
.Prompt = 'Toggle Debugger'

* Optional
Text To .Description Noshow && a description for the tool
Toggles the debugger windows on/off

Endtext
.StatusBarText = ''
.CanRunAtStartUp = .F.

* These are used to group and sort tools when they are displayed in menus or the Thor form
.Category = 'Windows' && creates categorization of tools; defaults to .Source if empty

Endwith

Return m.lxParam1
Endif

If Pcount() = 0
Do ToolCode
Else
Do ToolCode With m.lxParam1
Endif

Return

****************************************************************
****************************************************************
* Normal processing for this tool begins here.
Procedure ToolCode
Lparameters lxParam1

If Wexist('WATCH') Or Wexist('TRACE') ;
Or Wexist('CALL STACK') Or Wexist('LOCALS') ;
Or Wexist('DEBUG OUTPUT')
Close Debugger
Else
Debug
Endif

Endproc
Previous
Reply
Map
View

Click here to load this message in the networking platform