Using the Debug Tool

OpenLaszlo provides a helpful debugging tool. You can display the value of a variable and display any runtime error messages. To use the debug tool, use the debug attribute of the canvas tag:

<canvas debug="true">

Using the debug attribute will display the Debugger window as shown in Figure 1.6.

Figure 1.6. The Debugger window


You can configure the Debugger window by using the debug tag. For example, this debug tag sets the width and the height of the Debugger window that will be displayed.

<debug width="400" height="130"/>

Bear in mind that the debug tag can only be written as a direct child tag of the canvas tag.

From inside an LZX application, you can write to the Debugger window by using its write method:

Debug.write("a = " + a);

The Debugger window will be discussed further in Chapter 14, “Debugging and Deployment.”

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset