Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Expertise: Beginner
Aug 6, 1997



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Build Debugging/Profilling Into Your Code

To build debugging and profiling into your code, add this to the end of code lines:
 'Code line Add this line (n should be replaced
'by a unique number)
i = j + 1 '*dbg* "Debug n" & time
Turn debugging/profiling on by simply doing a replace on all modules of '*dbg* with :debug.print. When you run your code, the output will be sent to the debug window. To turn off debugging/profiling, replace :debug.print with '*dbg.* Even more interesting is the fact that you can do this at the procedure level as well. For example:
 Sub Form_Load () '*dbg* "form_load:" & Time;
after replacement:
 Sub Form_Load () : Debug.Print "form_load:" & Time;
Finally, if you like, you can change '*dbg* to a procedure name that could write all output to a file.
Robert Meyering
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date