Programming Statements

Understanding Symbol Tables

Whenever a variable is defined outside the module environment, its name is stored in the global symbol table. Whenever you are programming in immediate mode outside a module, you are working with symbols (variables) from the global symbol table. For each module you define with arguments given in a START statement, a separate symbol table called a local symbol table is created for that module. All symbols (variables) used inside the module are stored in its local symbol table. There can be many local symbol tables, one for each module with arguments. A symbol can exist in the global table, in one or more local tables, or in both the global table and one or more local tables. Also, depending on how a module is defined, there can be a one-to-one correspondence between variables across symbol tables (although there does not need to be any connection between a variable, say X, in the global table and a variable - say, X - in a local table). Values of symbols in a local table are temporary; that is, they exist only while the module is executing and are lost when the module has finished execution. Whether or not these temporary values are transferred to corresponding global variables depends on how the module is defined.

Previous Page | Next Page | Top of Page