User manual

mikroPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
233
begin
x_center := 50;
y_center := 60;
radius := 10;
end;
end.
Directives
Directives are words of special signicance which provide additional functionality regarding compilation and output.
The following directives are at your disposal:
- Compiler directives for conditional compilation,
- Linker directives for object distribution in memory.
Compiler Directives
mikroPascal PRO for dsPIC30/33 and PIC24 treats comments beginning with a $immediately following an opening
brace as a compiler directive; for example, {$ELSE}. The compiler directives are not case sensitive.
You can use a conditional compilation to select particular sections of code to compile, while excluding other sections.
All compiler directives must be completed in the source le in which they have begun.
Directives #DEFINE and #UNDEFINE
Use directive #DEFINE to dene a conditional compiler constant (“ag”). You can use any identier for a ag, with no
limitations. No conicts with program identiers are possible because the ags have a separate name space. Only one
ag can be set per directive.
For example:
{$DEFINE Extended_format}
Use #UNDEFINE to undene (“clear”) previously dened ag.
Note: Pascal does not support macros; directives $DEFINE and $UNDEFINE do not create/destroy macros. They only
provide ags for directive $IFDEF to check against.
Directives #IFDEF, #IFNDEF, #ELSE and #ENDIF
Conditional compilation is carried out by the #IFDEF and #IFNDEF directives. #IFDEF tests whether a ag is currently
dened, and #IFNDEF if the ag is not dened; i.e. whether a previous #DEFINE directive has been processed for that
ag and is still in force.