beautypg.com

6 automated login – Casio Naurtech CETerm Ver.5.5 Scripting Guide User Manual

Page 19

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 19


}
}

// Handle scan data in normal way
return 0;
}




The type argument to OnBarcodeRead contains the labeltype of the barcode.
This labeltype is related to the barcode symbology but usually a little more
informative. The values are dependent on the hardware manufacturer but for
most devices are the same as the Symbol LABELTYPE. The type is a small
integer value representing a printable ASCII character (See Appendix 3). The
source argument is the name of the scanner that read the barcode and is
typically unused. The date and time are text strings representing the time of
the read.

2.6

A

UTOMATED

L

OGIN

Automating the host login process is a common task to speed workflow. CETerm
contains a Macro record and playback that is usually used for this task. One
limitation of the Macro feature is that it will only support a single session auto-
connecting when CETerm starts. The scripting feature allows much more power
and flexibility for automating the login or any complex or repetitive process.

Most auto-

login features are based on a “prompt-and-response” mechanism that

waits for text from the host (the prompt) and then sends some text (the
response). The “expect” script and “ExpectMonitor” class provide the “prompt-
and-

response” mechanism within CETerm. The response is usually some simple

text, but with the ExpectMonitor, it can be a script itself. The ExpectMonitor is
also a good example of using script timers to perform long tasks. The full listing
of the “expect” script and “ExpectMonitor” can be found in Section 5.1.

When “expect” is used for auto-login, it is activated within the
“OnSessionConnect” event handler. Here is a simple example of an
OnSessionConnect handler

/* OnSessionConnect */
function OnSessionConnect ( session )
{
// Set login information
var myusername = "joeuser";
var mypassword = "secret";

This manual is related to the following products: