Please enable JavaScript to view this site.

ESL Documentation

Navigation: ESL Documentation > ESL 3270 Support > ECS Subroutines

Reading Information from the Screen

Scroll Prev Top Next More

ECS provides the following subroutines to get information from the host:

EcsReadLine

EcsReadLine copies the contents of row into a string variable. This subroutine is provided for screens that are line-oriented rather than field-oriented. Once you get the line contents into your string variable, you must parse this string to get the information you need.

EcsReadField

EcsReadField copies the contents of a field number into a string variable, including non-display fields. When you first arrive at a host screen, you can read the contents of the input fields into ESL string variables. You can then display this data in your dialog box or region for editing.

When you finish the transaction, you can copy the new value back into the host screen through EcsWriteField. You can do some of the validation before writing the data back to the host, and also process any error messages that may be generated by the host.

EcsReadFieldRowCol

EcsReadFieldRowCol dynamically retrieves a field number at runtime to ensure that you retrieve the correct data. This subroutine finds the field number specified by the row and column input arguments and copies its contents into an ESL string. The screen positions start at (1,1) in the upper left corner of the host screen. If the row and column are in the middle of a field, its field contents are read. If the given row and column are not inside a field, the contents of the closest field farther down the screen are read. You can use EcsReadFieldRowCol to examine the contents of non-display fields as well. This routine is useful when the screen position of a field does not change, but the field number does. This occurs most frequently as a result of field compression on the host.

EcsReadScreen

EcsReadScreen is more efficient than EcsReadLine or EcsReadField when retrieving screen-based reports or lists from the host. When using EcsReadScreen, it is possible to read partial screens to retrieve only the data you need. For example, a multiple-screen report often has the same title, column, or row headers and a footer. You can determine the location of the data and read the data into an ESL textual region for display.

EcsReadColoredScreen

EcsReadColoredScreen performs the same function as EcsReadScreen except that it does it for a colored screen. Thus, you must define your textual region with the colored attribute. This subroutine does not display characters in non-display fields.

EcsGetLastNonBlankLineNumber

If you have reports or lists of information of varying lengths, EcsGetLastNonBlankLineNumber returns the number of the last line on the host screen that contains data. You do not need to hardcode a line number into your ESL program.