Please enable JavaScript to view this site.

ESL Documentation

Prototype

subroutine EcsEnterString( string:String )

Description

Simulates the typing of an ASCII string on a terminal keyboard, start at the current cursor position, then pressing the enter key.   If the AutoWait feature is enabled, then the predefined watch command(s) within the global variables EcsWatchCommandString and EcsTimeLimit are used to attempt a screen synchronisation.

Parameters

String

Input

The text to be typed into the emulator. Note that the string can include tab "\t" characters to skip to the next input field on the screen.

Return Value

ECS_E_NOTINIT

Not initialized - command was ignored

ECS_E_NOTCONN

Not connected to an active session

ECS_E_SENDKEY

Failed to send keystroke(s)

ECS_E_INUSE

Session is already in use

ECS_E_BADKEYCODE

Key code is unrecognized

ECS_E_WATCH

Empty or invalid EcsWatchCommandString

ECS_E_MULTWATCH

Multiple watches are not currently supported

ECS_E_BADTIME

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

ECS_E_ERRORFREE

No errors were generated

Example

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

###  Actions to enter a string into the emulator

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

action EnterString is

    copy text of String_MLE in Write_DB to String_SV

    call EcsEnterString ( String_SV )

    copy errorlevel to ErrorLevel_IV

    copy "EcsEnterString" to Call_SV

    if ( ErrorLevel_IV = ECS_E_ERRORFREE ) then

        copy "Enter string was successful" to Message_SV

        action DisplayMessage

    else

        action DisplayError

    end if