beautypg.com

2 os.alert() – Casio Naurtech CETerm Ver.5.5 Scripting Guide User Manual

Page 121

background image

N

AURTECH

W

EB

B

ROWSER AND

T

ERMINAL

E

MULATION FOR

W

INDOWS

CE

AND

W

INDOWS

M

OBILE




CETerm Scripting Guide

Page 121


[Line: 14 Col: 9] Object doesn’t support this property
or method.


Unfortunately, the JScript engine does not return the source code line for a
runtime error. You must manually examine your scripts at the specified location
for a clue about the problem.

5.10.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 th

e “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 );
}
}

This manual is related to the following products: