10/27/11 note: We just added new doc for trace/debug statements, Jack says this topic can now be cut way down. But I didn't do it and I don't want to bug him, so the cutting down has not yet been done.
NoteTo manually open the message window (aka "Debug Dialog"), use Ctrl+Shift+DoubleClick somewhere on the A-Shell window, but preferably not on a control that might respond to a click. This will pop up a "GUI Control Operations" dialog, on which you can click the "Show Debug Dialog" button.
To programmatically open the message window, use one of the following ASB extended statements; see A-Shell Extensions.
The xxxx.OPEN statements are optional and mainly server to allow you to set the title on the message window. The xxxx.PRINT and xxxx.PAUSE statements will automatically open the message window if necessary.
The <msg> and <title> arguments are each limited to a single string expression (which may involve string operations and functions but must rely on concatenation to assemble a compound string of many parts, rather than commas or semicolons as you can do with PRINT). They may also start with zero or more of the following special control variables:
$# (displays the running message count as a message id #)
$T (displays the time in HH:MM:SS format)
$P (displays the program name in brackets, e.g. <MYPROG>)
For example, the following statement
DEBUG.PRINT "$T $P The value of X is: " + X
would appear something like:
11:25:01 <MYPROG> The value of X is: 25
Note that the first token of the message (space delimited) that does not start with $ cancels scanning for $T and $P and $#.
A special case of the <msg> expression takes the form of "SYSTRACE " following by a boolean indicator, e.g.:
TRACE.PRINT "SYSTRACE ON"
The above will force the system trace option associated with the message window to be turned on. (The manual way to do this is to right-click on the message window, click Properties, and then check the System Trace option.) Being able to do this from within a program is sometimes useful when you want to activate certain verbose traces but only for a short time, or starting at the beginning of a session, before you would have a chance to manually open the message window and turn on the traces automatically.
The xxxx.PAUSE statements are equivalent to the xxxxx.PRINT statements except that they output an additional message to the message window:
<Application paused - Double-click here to resume>
As suggested by the message, the application is then suspended while waiting for the user to double-click the message window. This is intended as alternative to the usual practice of display message boxes which require a click on the OK button to proceed. Note: Ctrl+C will abort the pause and pass the Ctrl+C to the program.
The actual wording of that message and the acknowledgement message when the double-click is received may be customized via the strings 005,002 and 005,003 in SYS:SYSMSG.xxx.
When the DEBUG.xxx or TRACE.xxx statements are executed on a server whose client is ATE, the message is forwarded to the ATE client to display. If the client is not ATE, the message is output to the standard ashlog.log.