#ifdef example
The following example uses #ifdef to check for a identifier named DEBUG to determine if extra code should be included to display trace information in the results pane of the Command window:
#define DEBUG // Comment out if not debug version
#ifdef DEBUG
#define TRACE(m) ? m
#else
#define TRACE(m)
#endif
...
// Process names in list
if form.rowset.first( )
do
TRACE( form.rowset.fields[ "Last name" ].value ) // Display name as we go
// Do whatever
until not form.rowset.next( )
endif
The macro-function TRACE( ) is defined so that if the DEBUG identifier is not defined, all calls to TRACE( ) are replaced with nothing—they are removed from the code and not compiled. This allows you to use TRACE( ) as much as you want, and with a simple change in the DEBUG identifier, remove all the code from the compiled byte code, resulting in better performance.