Please enable JavaScript to view this site.

ESL Documentation

Prototype

subroutine EcsWatch(integer: TimeLimit, string:WatchCommandString)

Description

Executes previously queued watch command(s) and activates a response you have defined to signal when a new screen is ready. Allows your application to take other responses while watch is in effect.

Parameters

TimeLimit

Input

The number of milliseconds to wait for the required screen.

WatchCommandString

Input

A string that contains the watch instructions.

Return Value

ECS_E_NOTINIT

Not initialized - command was ignored

ECS_E_NOTCONN

Not connected to an active session

ECS_E_WATCH

Empty or invalid WatchCommandString

ECS_E_MULTWATCH

Multiple watches are not currently supported

ECS_E_BADTIME

Illegal time limit specified (0 < time limit < 1 hour)

ECS_E_NOT3270SESSION

Not connected to a 3270 session - The EcsWatchForScreen command can only be used with a 3270 session.

ECS_E_ERRORFREE

No errors were generated

Example

###***********************************

###  Actions to watch for a new screen

###***********************************

action WatchForNewScreen is

    call EcsClearWatch ( EcsWatchCommandString )

    copy value of SettleTime_SB to SettleTime_IV

    call EcsWatchForIIOff ( SettleTime_IV, EcsWatchCommandString )

    call EcsWatch ( EcsTimeLimit, EcsWatchCommandString )

   if (errorlevel != ECS_E_ERRORFREE) then

        copy errorlevel to ErrorLevel_IV

        call DisplayError( ErrorLevel_IV )

    end if

 

response to stimulus EaselComServer ECS_WATCHDONE

    action NextScreenArrived

 

response to stimulus EaselComServer ECS_WATCHERROR

    copy eventparam to ErrorLevel_IV

    call DisplayError( ErrorLevel_IV )

 

response to EaselComServer ECS_WATCHGAVEUP

    action HostFrozen