User manual - Scripting_Guide

NAURTECH SMART CLIENTS FOR WINDOWS CE AND POCKET PC
CETerm Scripting Guide Page 46
{
// Look for "login" then "password"
expect( session, waittime, "Login", myusername + "\r",
"Password", mypassword + "\r" );
}
}
4.6 THE ONSESSIONDISCONNECT EVENT
The OnSessionDisconnect event is fired when a session is disconnected by a
user action. The handler can be used to switch to another session, exit, or
perform other cleanup tasks.
Syntax
function OnSessionDisconnect( session )
session – index of session which was disconnected by user.
Example
This example will switch to the next connected session when the current session
is disconnected. If there are no other connected sessions, then CETerm will exit.
/* OnSessionDisconnect */
function OnSessionDisconnect( session )
{
// Switch to next connected session
CETerm.SendIDA( "IDA_SESSION_NEXTLIVE", 0 );
if (CETerm.ActiveSession == session)
{
// Still on current session, no others connected.
CETerm.PostIDA( "IDA_PROGRAM_EXIT", 0 );
}
}