Previous Topic Next topic Print topic


References to Names

Use of a name in any context, other than in a declaration, constitutes a reference to the name. To determine the meaning of the reference, the Compiler searches for a declaration of the name. This search resolves the reference by associating it with a declaration. For example:

DECLARE A FIXED BINARY(15); 
DECLARE B FLOAT;

B = B+1;

A = A+1;

In the previous example, the Compiler knows that it must generate a floating-point add for B+1 because it has resolved the reference B to the second DECLARE statement. Likewise, it knows that it must generate an integer add for A+1 because it has resolved the reference A to the first DECLARE statement.

Previous Topic Next topic Print topic