Please enable JavaScript to view this site.

ESL Documentation

The use of variables and constants, in place of literals, helps make your programs more general, more readable, and more easily modified. You define as variables those entities that will change value during execution. You define as constants those entities that will retain their initial values throughout the program.

A constant is a named entity that holds a data value. You define the names, types, and values of constants, and then reference them in your program. The value specified in the constant's definition is permanent; it cannot be changed during execution.

You can use constants to identify values required by ESL statements. By specifying constant names rather than literals, you make it easier to change these values at some future time (before recompiling).

Suppose you define constants representing the width of a key and the vertical placement of a row of keys. After writing your ESL program, you might decide that the appearance of the graphics would be improved by changing the width and/or the placement of the keys. If you have defined the width and placement as constants, rather than literals, you will be able to change these values by simply changing the constant statement, rather than by modifying every key statement in the program.