5.1  Class Preamble


A Class encapsulates a set of related procedures and declarations. The preamble of the Class starts with the Class declaration followed by declarations for Structure, Record, and Enumerated types along with Import, Global, and Use declarations.

The Class body is coded after the declarations and lists the procedures belonging to the Class and designates which kind of procedure that they are. It can also include interface signatures used to make calls to external (often C/C++) procedures.


Primary Program Class


A program is built starting with a Program Class. You run the Gilda compiler and designate the Program Class on the Project parameter. The compiler first imports the Program Class along with all of its dependent Classes. Next it compiles the Root procedure and all of its dependent procedures into Object files. Finally the Linker program is invoked to create an executable file from the Object files.

The Program Class declaration cannot be a Generic Class nor can it inherit another Class. For additional details see Building A Program Class in the Installation Guide.


Primary Library Class


You can build a library by using a Library Class as the Project parameter. As in a program build the Library Class and its dependents are imported first. There is no Root procedure in a library. Instead all of the imported procedures are compiled and linked into a Library file. Subsequently when building a program, procedures in the Library file can be used within the program. For additional details see Building A Library Class in the Installation Guide.


Class File Syntax

Enumerated Type Declaration