[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 8.1 Source Structures

A source file accepted by GNU Pascal may contain up to one program, zero or more ISO-style modules, and/or zero or more UCSD-style units. Units and modules can be mixed in one project.

> The Program | The Source Structure of Programs
> 8.1.2 Label Declaration |
> 8.1.3 Constant Declaration |
> 8.1.4 Type Declaration |
> 8.1.5 Variable Declaration |
> Subroutine Declaration | Procedures, Functions and Operators
> Statements | Loops and Conditional Statements
> Modules and Units | Import Part and Module/Unit Concept

One trivial example for a valid GPC source file follows. Note that the code below may either be in one source file, or else the unit and the program may be in separate source files.

    unit DemoUnit;

    interface

    procedure Hello;

    implementation

    procedure Hello;
    begin
      WriteLn ('Hello, world!')
    end;

    end.

    program UnitDemo;

    uses
      DemoUnit;

    begin
      Hello
    end.

This document was generated by Frank Heckenbach on May, 10 2002 using texi2html