User manual
192
mikoPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
{ functions prototypes }
function function_name([var] [const] ParamName : [^]type; [var] [const] ParamName2,
ParamName3 : [^]type) : [^]type;
//********************************************************
//* Implementation:
//********************************************************
implementation
{ constants declarations }
const ...
{ types declarations }
type ...
{ variables declarations }
var Name[, Name2...] : [^]type; [absolute 0x123;] [external;] [volatile;] [register;] [sfr;]
{ labels declarations }
label ...
{ procedures declarations }
procedure procedure_name([var] [const] ParamName : [^]type; [var] [const] ParamName2,
ParamName3 : [^]type); [ilevel 0x123;] [overload;] [forward;]
{ local declarations }
begin
...
end;
{ functions declarations }
function function_name([var] [const] ParamName : [^]type; [var] [const] ParamName2,
ParamName3 : [^]type) : [^]type; [ilevel 0x123;] [overload;] [forward;]
{ local declarations }
begin
...
end;
end.
Note:
- Constants, types and variables used in the implementation section are inaccessible to other units. This feature is not
applied to the procedures and functions in the current version, but it will be added to the future ones.
- Functions and procedures must have the same declarations in the interface and implementation section. Otherwise,
compiler will report an error.
Scope and Visibility
Scope
The scope of an identier is a part of the program in which the identier can be used to access its object. There are
different categories of scope, which depends on how and where identiers are declared: