Units

Units are the individual source code modules that make up a Pascal program. A unit is a place for you to group functions and procedures that can be called from your main program. To be a unit, a source module must consist of at least three parts:

  • A unit statement—Every unit must have as its first line a statement saying that it's a unit and identifying the unit name. The name of the unit must always match the filename. For example, if you have a file named FooBar, the statement would be

    unit FooBar;
    
  • The interface part—After the unit statement, a unit's next functional line of code should be the interface statement. Everything following this statement, up to the implementation statement, is information that can be shared with your program ...

Get Borland® Delphi™ 6 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.