D028868 CR1500 CR1100 CR2700 JavaScript Programming Guide User Manual Page 15 of 41
The Code Corporation
12393 South Gateway Park Place, Suite 600, Draper, UT 84020
+1 (801) 495-2200
FAX +1 (801) 495-0280
Example:
if(reader.cabled == true)
reader.indicateError();
reader.locked
Note: The reader.locked property is not yet implemented.
The locked property of the reader object contains a Boolean value, which indicates whether
the reader is locked or not. The locked property also supports unlocking by assigning the
reader.locked property the valid unlock string.
Example:
reader.locked = “magic unlock string”;
if(reader.locked == true)
reader.indicateError();
reader.debug
The debug property of the reader object contains an integer value, which indicates the
reader’s current debug level.
Example:
dbglvl = reader.debug;
reader.debug = 1;
reader.decodes
The decodes property of the reader object contains a decodes object, which corresponds to
the previous decodes object passed to the onDecodes callback.
Example:
dcds = reader.decodes;
reader.bdAddr
The reader.bdAddr property is not yet implemented.
Reader Methods
reader.runScript
The runScript method instructs the Code reader to schedule the load, compile, and execution
of the specified JavaScript. The Code reader schedules execution of the script immediately
after the currently executing event handler or main script completes. The runScript method
does not include a mechanism to return to the calling script. Running a script causes the
currently executing JavaScript context and runtime to close, then opens a new, fresh context
and runtime. Any previously running script settings are lost when this happens. If more than
one script need to work together, use an include (“script”); statement within the main script.