Printing to the Log

You can print data to the ATEasy log. For example, you might want to send users text strings containing a UUT's manufacturer, model name, and serial number. You print output to the log by using either the Print statement or the Append method of the ALog control class.

Using the Print Statement

You use the Print statement to print text to the Test Log tab of the log window or the log control. You can print string and simple (non-array) numeric expressions to the log. The numeric expressions are converted to strings.

For example, the following statement prints a string to the Test Log tab:

Print "ATEasy";

If you assign a specific ALog control on a form in an application to the Log internal variable, then all Print statement output is routed to that ALog control.

You can use some Print statement parameters to control the format of your log output, depending on whether your log will be text or HTML. For information on setting log output to text or HTML format, see Logging Test Results.

Printing to a Text Log

If your log output will be in text format, you can use some escape sequences to control log format. If the Print statement does not end with a comma (,) or a semicolon (;) the print position is moved to the beginning of a new line after ATEasy outputs the string. You can also generate a new line by embedding the characters \r\n or \n inside a string Expression. For example, in the following print statement a new line is generated in a text log after "ATEasy":

Print "ATEasy\r\n"

If you embed escape sequences in a Print statement and the log is output in HTML, the escape sequences are ignored.

Printing to an HTML Log

If your log output will be in HTML format, you can use HTML tags to control log format. Rather than using the escape sequences described in the previous paragraph (\r\n or \n) to generate a new line, you would use the HTML paragraph tab, <P>. For example, in the following print statement a new line is generated in an HTML log after "ATEasy".

Print "ATEasy<P>"

In the following print statement, "ATEasy" is formatted as Heading 1 in an HTML log:

Print "<H1>ATEasy</H1>"

If you embed HTML tags in a Print statement and the log is output in text, the HTML tags will appear as text in the log.

For more information on ATEasy's Print statement, see Print Statement.

Using the Append Method of ALog

You use the Append method of the ALog control class to append text to the Test or Debug log. For example, the following statement prints the value of TestResult to the Debug log:

DebugLog.Append (Val(TestResult))

or alternatively, use the trace statement to append to the debug log window:

trace TestResult

For information on the Append method of the ALog control class, see Append Method (ALog).