Example Showing Different Forms of TRACE

The following example shows several different forms of the TRACE statement. The example uses Windows™ file naming conventions:
CREATE PROCEDURE testproc()
   DEFINE i INT;
   SET DEBUG FILE TO 'C:\tmp\test.trace';
   TRACE OFF;
   TRACE 'Entering foo';
   TRACE PROCEDURE;
   LET i = test2();

   TRACE ON;
   LET i = i + 1;

   TRACE OFF;
   TRACE 'i+1 = ' || i+1;
   TRACE 'Exiting testproc';
   
   SET DEBUG FILE TO 'C:\tmp\test2.trace';

END PROCEDURE