beautypg.com

Casio Naurtech CETerm Ver.5.5 Scripting Guide User Manual

Page 17

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 17


/* OnBarcodeRead */
function OnBarcodeRead ( session, data, source, type, date, time )
{
// Manipulate barcode data here

// Send barcode to emulator
CETerm.SendText ( data, session );

// Return 0 to handle barcode normally
// Return 1 if handled data here
return 1;
}

This handler simply passes the barcode data on to the current session using the
“SendText” method. The return value of 1 tells CETerm not to pass on the
barcode data with the usual wedge technique.

The following OnBarcodeRead handler will prefix 3 zeros to any 8 digit barcode
and pass other barcodes unchanged

/* OnBarcodeRead */
function OnBarcodeRead ( session, data, source, type, date, time )
{
// Prefix zeros to short barcodes
if (data.length == 8)
{
data = "000" + data;
}
// Send barcode to emulator
CETerm.SendText( data, session );

// Return 0 to handle barcode normally
// Return 1 if handled data here
return 1;
}


If the OnBarcodeRead handl

er is defined, it will override any “ScannerNavigate”

handler defined in a web page META tag. The following OnBarcodeRead
handler will pass the scan on to the ScannerNavigate handler for a web browser
in session 2

/* OnBarcodeRead */
function OnBarcodeRead ( session, data, source, type, date, time )
{
// Don’t process for browser session
if (session == 2)
{
// Return 0 to handle barcode with ScannerNavigate
return 0;
}

This manual is related to the following products: