...
end;
the first line of the declaration is the function heading and all of the succeeding lines make up the block.
Ch
,
L
,
Source
, and
Dest
are local variables; their declarations apply only to the
UpperCase
function block and override,
in this block only, any declarations of the same identifiers that may occur in the program block or in the interface or
implementation section of a unit.
Scope
An identifier, such as a variable or function name, can be used only within the scope of its declaration. The location
of a declaration determines its scope. An identifier declared within the declaration of a program, function, or
procedure has a scope limited to the block in which it is declared. An identifier declared in the interface section of a
unit has a scope that includes any other units or programs that use the unit where the declaration occurs. Identifiers
with narrower scope, especially identifiers declared in functions and procedures, are sometimes called local, while
identifiers with wider scope are called global.
The rules that determine identifier scope are summarized below.
Dostları ilə paylaş: