User manual - Scripting_Guide

NAURTECH SMART CLIENTS FOR WINDOWS CE AND POCKET PC
CETerm Scripting Guide Page 4
Methods.................................................................................................................................. 37
Properties ............................................................................................................................... 39
4.0 CETerm Script Events ............................................................................................................. 40
4.1 The OnBarcodeRead Event................................................................................................. 40
Syntax..................................................................................................................................... 40
Example.................................................................................................................................. 41
4.2 The OnDocumentDone Event.............................................................................................. 41
Syntax..................................................................................................................................... 41
Example.................................................................................................................................. 42
4.3 The OnNavigateError Event................................................................................................. 42
Syntax..................................................................................................................................... 42
Example For Windows CE 5.0 devices .................................................................................. 43
Example For Windows Mobile devices .................................................................................. 44
4.4 The OnNetCheckFailed Event ............................................................................................. 44
Syntax..................................................................................................................................... 44
Example.................................................................................................................................. 44
4.5 The OnSessionConnect Event............................................................................................. 45
Syntax..................................................................................................................................... 45
Example.................................................................................................................................. 45
4.6 The OnSessionDisconnect Event ........................................................................................ 46
Syntax..................................................................................................................................... 46
Example.................................................................................................................................. 46
4.7 The OnSessionDisconnected Event .................................................................................... 47
Syntax..................................................................................................................................... 47
Example.................................................................................................................................. 47
4.8 The OnSessionReceive Event ............................................................................................. 47
Syntax..................................................................................................................................... 47
Example.................................................................................................................................. 48
4.9 The OnSessionSwitch Event ............................................................................................... 48
Syntax..................................................................................................................................... 48
Example.................................................................................................................................. 48
4.10 The OnStylusDown Event.................................................................................................. 49
Syntax..................................................................................................................................... 49
Example.................................................................................................................................. 49
4.11 The OnWakeup Event........................................................................................................ 50
Syntax..................................................................................................................................... 50
Example.................................................................................................................................. 50
5.0 Scripting Techniques and Tips ................................................................................................ 52
5.1 Expect and ExpectMonitor for Automating Tasks................................................................ 52
5.1.1 Expect Script ................................................................................................................. 52
5.1.2 ExpectMonitor Class ..................................................................................................... 53
5.1.3 Automating Tasks with Expect ...................................................................................... 57
5.2 Presenting Visual Feedback During Script Execution ......................................................... 57
5.3 Getting User Input to a Script............................................................................................... 58
5.4 Running an External Program.............................................................................................. 59
5.5 Using Timers to Run Scripts ................................................................................................ 59
5.6 Accessing a File................................................................................................................... 60
5.7 Accessing the Registry ........................................................................................................ 61
5.8 Writing Efficient Scripts ........................................................................................................ 62
5.8.1 Use Local Variables ...................................................................................................... 62
5.8.2 Encapsulate Code in Functions .................................................................................... 63
5.8.3 Limit Execution Time ..................................................................................................... 63