File Name
Syntax
DbgCloseOutputWindow;
Parameters
None
Returns
None
Side Effects
None
Description
This function closes the debug output window if one exists.
Dialog Forms Called
None
File Name
Syntax
DbgCommonWrite(VAL bitmask:INTEGER, REF debugData:DbgDataRec, VAL str:STRING, VAL newLine:BOOLEAN, VAL strColor:INTEGER);
Parameters
debugData - debug data structure (with win handles, and so forth)
str - string to write to log(s)
newLine - write a newline at end of string
strcolor - color of string
Returns
A color
Side Effects
None
Description
This function writes the supplied string to the debug log window (if there is one), or to the debug file (if there is one). If the newLine flag is true, the function writes a newline character at the end of str. (This function is used by both DbgWrite and DbgWriteLn.)
Dialog Forms Called
None
File Name
Syntax
DbgEvent
Parameters
None
Returns
None
Side Effects
None
Description
This routine provides minimal event handling for the scrolling Debug Log window.
Dialog Forms Called
None
File Name
Syntax
DbgEventName(VAL msgCode:INTEGER, REF msgString:STRING, REF msgColor:INTEGER);
Parameters
msgCode - the $Msg constant (from $Event)
msgString - the string name of this $Msg constant
msgColor - the foreground color for this event type
Returns
-1 = Unknown msg code
(other value) = success
Side Effects
None
Description
This function translates the message constant passed in into a printable string.
Dialog Forms Called
None
File Name
Syntax
DbgEventOutput(VAL bitmask:INTEGER, VAL winHandle:WINDOW, VAL fieldname:STRING);
Parameters
bitmask - indicates which bits in the debug output vector to check before producing output.
If any match, output is performed.
winhandle - window receiving the event
winEvent - the event to be output (in the format $MsgXxx)
Returns
None
Side Effects
None
Description
This function performs debug output for event handlers. Output destination (file, ScrollWindow, stdout, or nowhere) is determined by the configuration of this module (as set by the DbgInitialize call).
Dialog Forms Called
None
File Name
Syntax
DbgInitialize(VAL filename:STRING, VAL parentwindow:WINDOW, REF menuBar:LIST OF STRING, VAL applicationName:STRING, VAL outputFlags:INTEGER, VAL controlFlags:INTEGER);
Parameters
filename - file name to receive output (if any)
parentWindow - parent window of output window (if any)
applicationName - name of application (for output stream)
outputflags and controlflags - debug function control flags
Returns
1 = success, appropriate output channels opened and ready
2 = success, no output channels opened (as requested)
0 = failure, the environment var "DEBUGON" was not defined.
anything else = Error
Side Effects
A file might be opened, or a window might be opened
Description
This function initializes the debug subsystem.
Dialog Forms Called
None
File Name
Syntax
DbgOpenOutputWindow(VAL parentwindow:WINDOW);
Parameters
parentWindow
Returns
1 = success
2 = already exists (made sure it was visible)
-1 = failed to call DbgInit first
-n = failure codes from CreateScrollWindow
Side Effects
None
Description
This function creates a debug output window if one does not already exist. It attempts to float an existing one to the top of the screen.
Dialog Forms Called
None
File Name
Syntax
DbgWrite(VAL bitmask:INTEGER, VAL str:STRING);
Parameters
bitmask - indicates which bits in the debug output vector to check before producing output.
If any match, output is performed.
str - string to be written to output
Returns
None
Side Effects
None
Description
This function performs debug output for the calling routine, but does not terminate the output with a newLine. See DbgWriteLn for further description.
Dialog Forms Called
None
File Name
Syntax
DbgWriteLn(VAL bitmask:INTEGER, VAL str:STRING);
Parameters
bitmask - indicates which bits in the debug output vector to check before producing output.
If any match, output is performed.
str - string to be written to output
Returns
None
Side Effects
None
Description
This function performs debug output for the calling routine. Output destination (file, ScrollWindow, stdout, or nowhere) is determined by the configuration of this module.
Dialog Forms Called
None
File Name
Syntax
NextStrColor(REF colorData:ColorRec);
Parameters
colorData - color list data structure
Returns
A color
Side Effects
None
Description
This function returns the next color from a circular list of colors. It is intended for use by writing routines to provide contrast among lines being written to the screen.
Dialog Forms Called
None