Please enable JavaScript to view this site.

ESL Documentation

Reference

Insert a text file into the current ESL program.

include FILE_NAME

FILE_NAME

A string value representing the name, including the extension, of a file containing ESL statements. Be sure to put the name in quotes.

Description

Use this statement to insert an ASCII text file containing ESL source code into the current ESL program.

You can specify any number of include references in an ESL program.

The file is inserted at the time that the program is compiled. ESL inserts all of the statements contained in the included file at the location at which the include reference is specified. After processing the last line of the inserted file, ESL continues to process the original file at the line following the include statement line.

The string literal that you specify in the include reference must be a filename. Although the examples shown in this guide use the extension .INC (for INClude), you can specify any other extension or none at all.

The include feature is especially useful when you want to use the same sequence of statements in more than one program, or when you want to divide your program into logically distinct units.

ESL generates error messages if you specify an invalid filename, too many levels of nesting, or a file that cannot be accessed or opened.

Nested Include Files

Included files can be nested; that is, each file can contain include statements. You can nest include statements to 20 levels. Make sure that no file includes itself or any other file that has already been included. If it does, each of the two files will cause the other file to become part of it each time ESL encounters the include statement, and inclusion will never end.

Example

program main.eal

screen size dialog units

include "message.inc" # ESL Library

include "esldde.inc" # include files

...

include "login.inc" # application logic