
31
Class Reference
4
Class Reference
The built-in objects described in this section enable a JavaScript program to receive data
from the handheld and control its behavior.
4.1
decode
The
decode
object provides data and metadata on the currently decoded barcode. Since
the
decode
object is passed from the decode engine to the JavaScript engine, any valid
variable name can be used to hold the data. For reasons of clarity, we will use the name
decode
. Other common uses seen in existing JavaScript code are
d
or
obj
.
The properties of the
decode
object define the raw output of the handheld decode engine.
4.1.1
Properties
The following section documents the properties defined for the
decode
object.
4.1.1.1
data
The
decode.data
property is a read/write value representing the payload of the barcode
that has just been decoded. This data may also include data processing, checksum
information, or data formatting based on settings made by the user for the decode engine.
If the decode engine has no special handling settings applied, this information should
match the string that was used to encode the barcode before the barcode was printed or
displayed.
If the current JavaScript program makes a change to the data, it can be stored back into
the
decode.data
object in order to pass it downstream.
Example:
//remove all Group Separator characters
decode.data = decode.data.replace(/%1D/g, "");
return decode;
4.1.1.2
symbology
The
decode.symbology
property is a read only property that contains the symbology of
the barcode decoded by the decode engine.
Valid values for
symbology
are defined in 9.
Example:
//Code Symbology Identifier (38 is PDF417)
if (decode.symbology == 38)
{
//Perform action on PDF417
}
Содержание OHV300
Страница 1: ...FACTORY AUTOMATION MANUAL JAVASCRIPT PROGRAMMING GUIDE...
Страница 88: ...88 Supported JavaScript Core delete function in instanceof new this typeof void...
Страница 93: ...93 Symbology ID Modifier Information...
Страница 94: ...TDOCT 4981_ENG 11 2015...