Sign in Join
Wiki copytemporary

Interface: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Interface

OldNewLine
1+Back to [[Reserved words]].
2+
3+The reserved word **interface** is used to structure (subdivide) a [[Unit|unit]]. This is distinct from the [[Interfaces]] facility which relates to class management.
4+
5+Everything that has been declared in the interface section can be used by this and other units. It is the *public part* in other languages.
6+
7+Example of a unit structure:
8+
9+``` pascal
10+ unit ...; // Name of the unit
11+
12+ interface // Everything declared here may be used by this and other units (public)
13+
14+ uses ...;
15+
16+ ...
17+
18+ implementation // The implementation of the requirements for this unit only (private)
19+
20+ uses ...;
21+
22+ ...
23+
24+ initialization // Optional section: variables, data etc initialised here
25+
26+ ...
27+
28+ finalization // Optional section: code executed when the program ends
29+
30+ ...
31+ end.
32+```
33+
34+---
35+*From the Free Pascal wiki, page "Interface", as it stood on 2020-02-25 after a change by MarkMLl, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history