Trace

From CometWiki

(Difference between revisions)
Jump to: navigation, search
(Initial Construction of page)
(minor)
Line 8: Line 8:
|<b>Introduction:</b>
|<b>Introduction:</b>
|
|
-
The trace statements allow you to easily debug your IB programs whether they run in foreground or background. When Tracing, a "Trace window" pops up on the console of the Comet machine that displays much of what you would want to see to follow the progress of the program.
+
The trace statements allow you to easily debug your IB programs whether they run in foreground or background. When Tracing, a "Trace window" pops up on the console of the Comet machine that displays much of what you would want to see to follow the progress of the program. Trace statements are executable statements.
|-valign="top"
|-valign="top"
| '''Syntax:'''
| '''Syntax:'''
Line 16: Line 16:
  Trace on
  Trace on
This is an executable statement than can be placed anywhere in your program. When Comet encounters this command it will pop up the trace window and tracing will continue until the program ends or the Trace off command is executed.
This is an executable statement than can be placed anywhere in your program. When Comet encounters this command it will pop up the trace window and tracing will continue until the program ends or the Trace off command is executed.
-
The following commands control the information displayed in the trace window. By default most of these items are enabled when tracing.
+
The following commands control the information displayed in the trace window. By default most of these items are enabled when tracing. In addition to these, whenever a Comet32 Proc is entered and whenever a comet32 ProcReturn is executed, this info is displayed.
   Trace Labels on/off  
   Trace Labels on/off  
-
Displays whenever a program lable is hit during execution
+
Displays whenever a program label is hit during execution
   Trace Source on/off  
   Trace Source on/off  
If the source files are available when executing the program, the source line is displayed.
If the source files are available when executing the program, the source line is displayed.
Line 27: Line 27:
   Trace Exceptions on/off  
   Trace Exceptions on/off  
Each time an exception is encountered in the program, the exception is displayed.
Each time an exception is encountered in the program, the exception is displayed.
-
 
+
Trace Print string-expression
 +
Displays the string expression in the trace window.
|-valign="top"
|-valign="top"
| '''Discussion:'''
| '''Discussion:'''
|
|
 +
The trace window is a single window owned by Comet32. All trace output is displayed in this window from all programs actively tracing whether these are background or Foreground, xap or CometAnywhere. This can be useful to see interaction among programs, but can be disconcerting if sometimes.
 +
 +
If the source file is not available in the same directory from which it was compiled, at execution time, the line number information will be displayed, but not the source.
 +
|-valign="top"
|-valign="top"
-
|'''Example 2:'''
+
|'''Example:'''
-
Reading a CSV record
+
 
|
|

Revision as of 19:16, 1 July 2011

Debugging your IB programs using the Trace Commands

Introduction:

The trace statements allow you to easily debug your IB programs whether they run in foreground or background. When Tracing, a "Trace window" pops up on the console of the Comet machine that displays much of what you would want to see to follow the progress of the program. Trace statements are executable statements.

Syntax:

Trace on / Trace off There are several trace commands that control the detail of the information displayed in the trace window, but the only statement you need to use to see tracing is:

Trace on

This is an executable statement than can be placed anywhere in your program. When Comet encounters this command it will pop up the trace window and tracing will continue until the program ends or the Trace off command is executed. The following commands control the information displayed in the trace window. By default most of these items are enabled when tracing. In addition to these, whenever a Comet32 Proc is entered and whenever a comet32 ProcReturn is executed, this info is displayed.

  Trace Labels on/off 

Displays whenever a program label is hit during execution

  Trace Source on/off 

If the source files are available when executing the program, the source line is displayed.

  Trace Time on/off 

A time stamp is displayed on each trace line. This is turned off by default.

  Trace Events	on/off	

Each time an event is fired in the program, the event information is displayed.

  Trace Exceptions on/off 

Each time an exception is encountered in the program, the exception is displayed.

Trace Print string-expression

Displays the string expression in the trace window.

Discussion:

The trace window is a single window owned by Comet32. All trace output is displayed in this window from all programs actively tracing whether these are background or Foreground, xap or CometAnywhere. This can be useful to see interaction among programs, but can be disconcerting if sometimes.

If the source file is not available in the same directory from which it was compiled, at execution time, the line number information will be displayed, but not the source.


Example:


The Trace statement was introduced in Comet 2011 build 444. These commands are available in Comet32 only.

Personal tools