Please enable JavaScript to view this site.

ESL Documentation

You can use a structure instead of a series of variables to group all the arguments of an ESL subroutine under one name. This makes it easier to pass the arguments to an ESL subroutine. For example:

 

# Structure variable declaration:

structure EmployeeRecord Employee

 

# Subroutine declarations:

subroutine GetEmployeeData(structure EmployeeRecord: Emprec)

 

subroutine UpdateEmployeeDB(structure EmployeeRecord: Emprec)

 

# Subroutine calls:

call GetEmployeeData (Employee)

call UpdateEmployeeDB (Employee)

 

This example declares a structure variable of type EmployeeRecord. It declares two subroutines, GetEmployeeData and UpdateEmployeeDB, that take a structure of type EmployeeRecord as their only argument. Then it calls each of these subroutines, passing the declared structure variable. The first subroutine, GetEmployeeData, fills the structure with data from the screen. The second subroutine, UpdateEmployeeDB, uses the information in the structure to add or update a record in the employee data base.