ESL Communications Server (ECS) defines a set of subroutines. You must declare variables of the corresponding argument types in order to pass them to the subroutines.
In the following example, the program reads a group name contained in the third field of the 3270/5250 screen buffer, and branches off, depending on the contents of the output string FieldContents_SV.
# ESLCMSRV.INI contains definitions of all ECS subroutines,
# constants, and a stimulus declaration.
include " eslcmsrv.inc"
# Variable Declarations
# Integer variable FieldNumber_IV will contain the number of a
# particular field, and string variable FieldContents_SV will
# possess information contained in that field.
integer variable FieldNumber_IV
string variable FieldContents_SV ...
# Object Declarations ... action Changer is ...
# We are interested in information contained in field #3. By
# passing this input to EcsReadField, we will get the contents
# of a field read into FieldContents_SV variable, which we can
# manipulate after this call to ESLCMSRV.DLL. In this example,
# we will invoke different programs, depending on the contents
# of field #3.
copy 3 to FieldNumber_IV
call EcsReadField( FieldNumber_IV, FieldContents_SV )
switch FieldContents_SV is
case char "Development" is
change to program " MainDv"
case char "Support" is
change to program " MainS"
case line "Documentation" is
change to program " MainDc"
case line "QA" is
change to program " MainQA"
default is
send "ERROR has occurred\n" to errorlog
end switch