Displaying Test Results with the Log Control

The ALog control provides a versatile way to record test results.

Using the Append() method, the user can send data and text to the log control.

If the log's PlainText property is set to True (1), you can use the Navigate() method to view any accessible file or URL as plain text. If the log's PlainText property is set to False (0), which is the default, the file or URL will be retrieved and interpreted as HTML.

Since the ALog control is based on Microsoft Internet Explorer, you can format the data and text using standard HTML formatting commands. You can embed hyperlinks and images, as well.

For example, here is a series of commands that sends HTML text to the window of the ALog control, here called "log1":

log1.Append("<H1>Heading</H1>")

log1.Append("<P>This is a quantity of paragraph text which <FONT COLOR = RED>exceeds</FONT> expectations.</P>")

This results in the following output within the log window, which is the central control on the form below:

You can also assign HTML text to a string variable (making sure that you declare the variable and its type in the variables window):

stext="<P><FONT FACE=Tahoma>Now is the time for all good women</FONT></P>"

log1.Append(stext)

There are a few points that need to be made about outputting HTML to the form:

It may be necessary to put double quotes or exclamation points in your HTML within ATEasy's editor. The problem is that double quotes are the string delimiter, and the exclamation point sets off a comment. Within text, this is no problem, because you can use the &quot; and &#033; glyph for " and ! respectively. However, you can't use glyph inside your HTML tags. So, you can use ATEasy's quotation character, the backslash (\), before your double quotes and exclamation points. Thus:

log1.append("<IMG SRC=\"notebook.gif\">")

The backslashes will be filtered out before the text gets to your ALog control.