User manual - Scripting_Guide

NAURTECH SMART CLIENTS FOR WINDOWS CE AND POCKET PC
CETerm Scripting Guide Page 65
5.9.2 OS.Alert()
Because there is no JScript debugger on the Windows CE device, the tried-and-
true debugging tool is “OS.Alert( message )”. Experienced programmers will
recognize this as the “write(6,100)”, “printf” or “MessageBox” technique.
The basic idea is to sprinkle “OS.Alert()” calls through your code to track program
flow and variable values. It can be tedious, but it’s easy to do and easy to
remove the OS.Alert() calls by preceding them with comment characters.
Alternatively, you can define a Debug() method and sprinkle it through your code.
This makes it easier to enable or disable debugging.
var globalDebugLevel = 0;
function Debug( message )
{
if (globalDebugLevel > 0)
{
OS.Alert( message );
}
}