User manual - Scripting_Guide

NAURTECH SMART CLIENTS FOR WINDOWS CE AND POCKET PC
CETerm Scripting Guide Page 48
session – index of session which received data.
count – count of bytes received.
Example
This example will check the screen content on line 24 looking for an error
message. If found, the error is displayed as a popup message.
/* OnSessionReceive */
function OnSessionReceive( session, count )
{
// Get line of text
var s = CETerm.Session( session ).Screen;
var line = s.GetTextLine( 24 );
// Do a regular expression case-insensitive match
if (line.match( /error/i ))
{
OS.Alert( "Error: " + line );
}
}
4.9 THE ONSESSIONSWITCH EVENT
The OnSessionSwitch event is fired when the active session changes. The
handler can be used to perform a session specific action.
Syntax
function OnSessionSwitch( session, previousSession )
session – index of session which became active.
previousSession – index of session which was previously active.
Example
This example will reposition the battery information item depending on which
browser session is active.
/* OnSessionSwitch */