D028868 CR1500 CR1100 CR2700 JavaScript Programming Guide User Manual Page 9 of 41
The Code Corporation
12393 South Gateway Park Place, Suite 600, Draper, UT 84020
+1 (801) 495-2200
FAX +1 (801) 495-0280
Mastering Regular Expressions
by Jeffrey E F Friedl
Beginning Regular Expressions (Programmer to Programmer)
by Andrew Watt
http://en.wikipedia.org/wiki/Regular_expression#Basic_concepts
http://www.regular-expressions.info/
Installing and Running a .codeRules.js script on the Code Reader
The Code-supplied JavaScript file .cra.js is written to check for and include a Code Rules file located on the
reader. The file name must conform to the following regular expression: /^\.codeRules*\.js/
The purpose for Code Rules files is primarily to provide override functions for decode attempt, decode, and
onEvent.
Security
Code supplies an encryption utility for license protection:
Each Code reader contains a unique reader ID
Select features of the reader are protected by license
Code provides a license file that activates protected features
A license file is required for each reader licensed to use protected features
Third-party software may also be protected using an encryption utility
Debugging (See reader.debug)
Programming Concepts
To help the Developer create unique applications for the reader, Code provides an easy-to-use, object-oriented
JavaScript Application Programming Interface (API). The Developer can create complex business applications
with prompts and data-entry, through the JavaScript API.
The features of the programming interface include:
Event handlers
Symbol decoding
Host communications
Local data storage
Code reader configuration
In support of this interface, Code has provided three objects which support these features:
Reader
Storage
Comm
There are also shell functions to provide utility functionality, not directly related to these objects. Using these
features, the user can create robust, interactive, and sophisticated user applications.
A user-defined script may be configured as the default script, or started via a command from a host utility or a
command from a barcode. Please be aware that any JavaScript file that is run remains active (variables &
functions) until the next reset, or until a different script is run. Each time a script is run (executed), the reader
closes, resets, and restarts the JavaScript engine.