Device Channel 10
|Top Previous Next|
Device 10 is an output channel that sends text to Windows dialog box. This means that you can send text from any XPL Intrinsic that can output bytes to a device channel. This is very useful for debugging. To redirect data from the dialog box, you simply use 10 as the device number. For example, Text(10,"Hello World"); would send the string "Hello World" to the dialog box.
Displaying The Dialog Box. The dialog box can be displayed by selecting the Debug -> Device 10 Output option from the menu bar. The Device 10 display is also available in a Stand Alone program by right clicking on the window and selecting the Device 10 Output option.
Debugging. The primary use of the Device 10 is for debugging. A standard debugging technique for XPL is to print text at various points in the program to trace program execution or to display variable values. This works well in some text programs, but is problematic in a graphics program. For example, the debug text may be overwritten and obscured by the graphics display. Likewise, the text may also interfere with graphic operations so you can't see key portions of the image.
Device channel 10 avoids these problems by directing text to a separate dialog box. This way, the print statements never interfere with the graphic display. Because this feature is a device channel, any intrinsic that sends output to a device channel can be used to display debug information. For example, the IntOut, RlOut, Text and CRLF intrinsics can be used for generating debug print statements.
As an example of using Device Channel 10, here is a snippet of code that illustrates the process: