User Tools

Site Tools


scope_of_variables_and_type_declarations.htm
Navigation:  Language Reference > 3 - Variable Declarations > Data Declarations and Memory Allocation >====== Scope of variables and type declarations ====== Previous pageReturn to chapter overviewNext page

This topic describes the scope of variables and type declarations.

Type Declaration Scope is shown as follows:

GLOBAL > MODULE > PROCEDURE

PROCEDURE > Procedure ROUTINE

PROCEDURE > CLASS > METHOD > Method ROUTINE

Referring to the illustration above:

Anything from a PROCEDURE section can reference anything from the MODULE or GLOBAL sections.

Anything from the MODULE section can reference anything from the GLOBAL section.

Referencing in the other direction is not permitted..

In our illustration above the scope of a TYPE declaration moves from left to right.

Anything declared on the left can be used on any right scope AND anything declared on the right levels are not accessible to any level that is on the left side.

A procedure needs to be added to the MAP inside a named MODULE to be accessible to others MEMBERs.

If a procedure or type is declared in a MEMEBER local MAP, it can be added and EXPORTED except it it has the PRIVATE attribute applied.

See Also: Global, Local, Static, and Dynamic

PRIVATE (set variable or procedure private to a CLASS module)

scope_of_variables_and_type_declarations.htm.txt · Last modified: 2021/04/15 15:57 (external edit)