|
#Trace | ||
#Trace Flag | ||
Parameters: Flag = The ON/OFF flag to disable/enable the compilers STEP/TRACE mode |
||
Returns: NONE | ||
#Trace allows the programmer to control over the compilers generation of special debugger information during the compile process. In case your unsure, when a program is compiled in Debug TRACE mode. The debugger requires PlayBASIC to compile code in a special way. It has insert special codes inside your program. These codes are normally embedded at the start of each line of code. What they do, is act as a communication bridge between your program while it's running and the debugger. While this allows for greater hands on control of running program, as the debugger and the program are interleaved together, the down side is that this extra code can add a great deal of overhead to your programs performance. So programs compiled in Debug/Trace mode, will often performance very slowly. This is where the #Trace detective really comes into it's own. #Trace allows you to manually enable/disable the compilers generation of these debugger codes at any point throughout your program. This lets you to run certain parts of your program with debugger codes embedded and other parts without them. Thus giving much greater performance and allows you to only focus your debugging efforts on any new code your working on, rather than your entire program. It's important to note, that the #TRACE directive is only available when your compiling a program in DEBUG TRACE. If not, PlayBASIC will ignore these statements completely. FACTS: * #TRACE is only available when a program is compiled in a DEBUG TRACE mode, F6 is the keyboard short cut from in the IDE. Mini Tutorial: In this example were going to use force the compile not to insert tracing debugger code inside a loop. NOTE: This code must be run in DEBUG TRACE mode in order for you to see the results.
When compiled in DEBUG TRACE mode this example outputs the following on my test machine. The result will vary for different machines Screen Output
|
Related Info: | #Break | #Print : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |