1
0
lazarus-tutorials/unit_outline.pas

65 lines
1.1 KiB
ObjectPascal
Raw Permalink Normal View History

2021-10-08 14:32:49 -04:00
unit unit_outline; // mandatory unit name
interface // mandatory 'public' declaration section
uses
Classes;
// Global typed
type
TCountry = record
Name: string;
Area: LongInt;
end;
// Global variables
var
aCountry: TCountry;
// Global constants
const
GoldenSection = 1.62;
// Global/public interface
procedure ExampleProc;
implementation // mandatory 'private' declaration section
// 'Private' imports
uses
StrUtils;
// Type declarations private to this implementation section
type
TCar = record
Make: string;
Model: string;
ModelYear: UInt16;
end;
// Variables private to this implementation section
var
aCar: TCar;
// Constants private to this implementation section
const
password = 'hiddenPassword';
procedure ExampleProc;
procedure HiddenProc;
begin
// code for the nexted procedure HiddenProc
end;
begin
// code for the main body of global procedure
HiddenProc;
end;
initialization
// optional initializatino code codes here
finalization
// optinal final (clean-up) code goes here
end. // mandatory unit end