Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Implementation Section of a Unit
◄Keywords► ◄Contents► ◄Index► ◄Back►
IMPLEMENTATION
[ USES Clause ]
[ LABEL Declarations ]
[ CONST Declarations ]
[ TYPE Declarations ]
[ VAR Declarations ]
[ PROCEDURE Declarations ]
[ FUNCTION Declarations ]
END │ \aStatement Block
Description
The implementation section of a unit contains the definitions of
procedures and functions declared in the interface section of
the unit. The implementation section can also contain the
declaration of labels, constants, types, variables, functions,
and procedures for the internal use of the unit. These internal
declarations are private and are not accessible to the program
using the unit.
Note the optional statement block at the end of the declarations.
This statement block exists to contain any initialization code
that the unit's services require. This feature sets a unit apart
from a mere library. For instance, it could contain code that sets
interrupt vectors. It could also contain code that handles error
conditions or any other house-cleaning chores that the unit's
services might require.
The run-time system executes a unit's initialization code the first
time it encounters the unit's name in a uses clause. It only
executes the initialization code once. This is true even if a unit
appears in more than one uses clause.
See also: INTERFACE, UNIT, USES