Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Debug mode
Message
De
22/02/1998 10:36:48
 
 
À
22/02/1998 10:08:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00080304
Message ID:
00080327
Vues:
36
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform