3 the onibmcommand event, Syntax, Example – Casio Naurtech CETerm Ver.5.5 Scripting Guide User Manual

Page 85: Ibmc

Advertising
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 85


b.AddMetaItem( "Signal", "y=100" );

// Update information items for location to take effect
CETerm.PostIDA( "IDA_INFO_REFRESH", session );
}
}

4.3

T

HE

O

N

IBMC

OMMAND

E

VENT

The OnIBMCommand event is fired when a special extended command format is
received in an IBM emulation session screen. Extended commands are
documented elsewhere, but basically this event requires the two ch

aracters “#X”

starting in the second column of the first row. The CETerm configuration option
“Extended Commands” must be enabled for this event to fire. The handler script
may perform any desired actions. Typically, the screen text contains additional
information used by the handler.

Syntax

function OnIBMCommand ( session, command )

session

– index of session receiving the command

command

– specified command (e.g., “#X” )


Example

This example looks at the data following the command and activates an FTP file
transfer.

/* OnIBMCommand */
function OnIBMCommand ( session, command )
{
// Get full line from screen
// Expect: #X|FTP|myserver|localfilename|remotefilename
var line1 = CETerm.Session( session ).Screen.GetTextLine( 1 );
var args = line1.split( "|" );

// Activate FTP
if ("FTP" === args[1])
{
var ftp = OS.Network.FTP;
if (0 === ftp.Login( args[2], "ftpuser", "secret" ))
{
ftp.PutFile( args[3], args[4] );
ftp.Logout();
}
}

Advertising
This manual is related to the following products: