Chapter 4: Viewing Code and Data
Using Expressions
To print formatted output to a window
• Using the command line, enter:
Expression Fprintf
Enter the number of the user-defined window, the format string (enclosed in
quotes), and the arguments; then, press the < Return> key.
The formatted output is written to the user-defined window. This command is
similar to the C fprintf function.
The debugger associates the log file window (window no. 28) with a log (.com)
file so that you can write output to that window using the Expression Fprintf
command. This window is not displayed. It is used only for writing to a
command file.
The debugger associates the journal file window (window no. 29) with a
journal file so that it can write journal window output to the journal (.jou) file.
Additional output may be written to the journal file by writing to window 29.
Examples
To print the value of var to user window 57 as a single character:
Expression Fprintf 57,"%c",var
To print a string in double quotes to user window 57 followed by the floating
point value of 'float_temp' with a precision of 2:
Expression Fprintf 57,"The value of 'float_temp' is:
%.2f \n",float_temp
To print formatted output to journal windows
• Using the command line, enter:
Expression Printf
158