Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
Main Unit
Every project in mikroPascal PRO for AVR requires a single main unit file. The main
unit file is identified by the keyword 
program
at the beginning; it instructs the com-
piler where to “start”.
After you have successfully created an empty project with the Project Wizard, the
Code Editor will display a new main unit. It contains the bare-bones of the Pascal
program:
program MyProject;
{ main procedure }
begin
{ Place program code here }
end.
Nothing should precede the keyword program except comments. After the program
name, you can optionally place the uses clause.
Place all global declarations (constants, variables, types, labels, routines) before the
keyword begin.
Other Units
Units other than main start with the keyword 
unit
. Newly created blank unit contains
the bare-bones:
unit MyUnit;
implementation
end.
Other than comments, nothing should precede the keyword 
unit
. After the unit
name, you can optionally place the 
uses 
clause.
Interface Section
Part of the unit above the keyword 
implementation
is referred to as interface sec-
tion. Here, you can place global declarations (constants, variables, labels and types)
for the project.
You do not define routines in the interface section. Instead, state the prototypes of
routines (from implementation section) that you want to be visible outside the unit.
Prototypes must match the declarations exactly.
134
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroPASCAL PRO for AVR
CHAPTER 5