User manual - Scripting_Guide

NAURTECH SMART CLIENTS FOR WINDOWS CE AND POCKET PC
CETerm Scripting Guide Page 59
var s = t.GetInput();
if (s == 1)
{
OS.Alert( "Password is " + t.Input );
t.Input = ""; // Clear password
}
else
{
OS.Alert( "Failed to get password." );
}
5.4 RUNNING AN EXTERNAL PROGRAM
It is possible to start an external program from the CETerm script engine. You
can wait for the program to finish or allow it to run independently. Usually you
will run a program then return to CETerm when it exits.
Here is an example to start the stylus calibration. Note that the arguments
depend on whether your device is Window CE or Windows Mobile.
/* Stylus Calibration */
// TODO: Uncomment the line for your device
// For Windows CE 5.0 devices
OS.Exec( "\\Windows\\ctlpnl.exe", "cplmain.cpl,9,1" );
// For Windows Mobile 5 devices
//OS.Exec( "\\Windows\\ctlpnl.exe", "cplmain.cpl,7,0" );
5.5 USING TIMERS TO RUN SCRIPTS
Script execution timers are useful for several tasks. They can be used to:
1. Defer an action which is not possible in an event handler.
2. Perform an action periodically.
3. Provide an asynchronous script execution.
4. Split up a long running task.
We have already shown how the timer is used with the ExpectMonitor class and
task automation in Section 5.1. Event handlers should be limited to a small
amount of processing. If more processing is needed, it is best to schedule that
processing with SetTimeout() and allow the event handler to exit.