Prototype
subroutine EcsWriteField( integer:FieldNumber, string:String, integer:FillSwitch )
Description
Simulates the typing of a string of data into a specified field.
Parameters
FieldNumber |
Input |
An integer that specifies the field start at 1 for the first field on the screen. The field numbers can be determined using the EslFields utility. |
String |
Input |
The text to be typed into the specified field. |
FillSwitch |
Input |
An integer flag that determines how the field will be completed, if the string is not longer enough to complete the space available. The options are: ECS_NOFILL - characters will be left unchanged, ECS_FILLWITHNULLS - remaining characters will be replaced by NULLs, ECS_FILLWITHBLANKS- remaining characters will be replaced by blanks. |
Return Value
ECS_E_NOTINIT |
Not initialized - command was ignored |
ECS_E_NOTCONN |
Not connected to an active session |
ECS_E_NOFLDS |
Screen contains no fields |
ECS_E_FLDNUM |
Invalid field number |
ECS_E_PROTFLD |
Attempt to write protected field |
ECS_E_FILLSWITCH |
Invalid fill switch specified |
ECS_E_ERRORFREE |
No errors were generated |
Example
###*****************************
### Actions to Write to a field
###*****************************
action WriteField is
copy text of String_MLE in Write_DB to String_SV
copy text of FieldNum_SB in Write_DB to FieldNum_IV
extract from text of FillOptions_CMB
skip by 38
take by number FillOptions_IV
call EcsWriteField ( FieldNum_IV, String_SV, FillOptions_IV )
copy errorlevel to ErrorLevel_IV
copy "EcsWriteField" to Call_SV
if ( ErrorLevel_IV = ECS_E_ERRORFREE ) then
copy "Type string was successful" to Message_SV
action DisplayMessage
else
action DisplayError
end if