Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Debug mode
Message
From
22/02/1998 10:36:48
 
 
To
22/02/1998 10:08:46
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00080304
Message ID:
00080327
Views:
32
>There are a number of ways to do this. One way is to designate a file as a debug mode indicator.
>
>IF FILE("debug.txt")
> DEBUGOUT PROGRAM() && or whatever
> SET ESCAPE ON
> *... and so on
>ENDIF
>
>
>Now placing a file named DEBUG.TXT in the path gives you alternate behavior.
>
>With this general mechanism in mind, I'd be prone to abstracting the process a little, like this:
>
>IF oApp.DebugMode()
> DEBUGOUT PROGRAM() && or whatever
> SET ESCAPE ON
> *... and so on
>ENDIF
>
>Where the code to test the mode is centralized. This way you could easily change the debug mode trigger, as well as run common code for all debug breaks, all maintained centrally.


I do something very similar. When the Debug.txt file exists, I add a Debug menu that lets do lots of things like launch the debugger, display the data session (view) window, send stuff to the printer, suspend, cancel, etc.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform