User manual - Scripting_Guide

4.0 CETerm Script Events
This section describes the script events within the CETerm script engine. These
events provide ways to trigger event handlers when various conditions occur in
CETerm. The event handlers are arbitrary scripts.
The event model in CETerm uses specific event handler names to bind events to
handlers. If the event handler function (e.g., “OnBarcodeRead”) is defined in the
script engine, it will be executed when the event occurs. There is no special
command required to register or bind the function to the event. Event handlers
can be re-defined at any time. If the handler is no longer needed, the function
can be re-defined as empty.
Event Fired when…
OnBarcodeRead Barcode read.
OnDocumentDone New web page loads.
OnNavigateError Web navigation fails.
OnNetCheckFailed Fails to complete network check to host.
OnSessionConnect Session connects to host.
OnSessionDisconnect Session disconnects from host.
OnSessionDisconnected Session disconnected by host.
OnSessionReceive TE session receives data from host.
OnSessionSwitch Active session changes.
OnStylusDown Stylus tap on screen.
OnWakeup Device resumes after a suspend.
4.1 THE ONBARCODEREAD EVENT
The OnBarcodeRead event is fired when a barcode is successfully read. The
handler can pre-process the data or check other conditions prior to passing it on
to a TE or browser session.
Syntax
function OnBarcodeRead( session, data, source, type, date, time )
session – index of currently active session
data – barcode data
source – source of barcode. Typically a constant scanner name.
type – labeltype of barcode. See Appendix 3 for values.
date – date of barcode read.
time – time of barcode read.