home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
PASTUT34
/
COMPDIR.TXT
< prev
next >
Wrap
Text File
|
1993-01-15
|
3KB
|
68 lines
COMPILER DIRECTIVES.
--------------------
When a program is compiled, certain features such as range checking or the
generation of debug information, can be controlled through 'Compiler
Directives'. A compiler directive is a comment with a special syntax.
Comments are written within braces { and } , and compiler directives all
start with $ followed by a name of one or more letters and then possibly
+ or - or filename.
The current default directives are automatically listed at the top of any
program by means of the key sequence CTRL O followed by O (alone). Typical
values are shown below:
{$A+,B-,D+,E+,F-,G-,I+,L+,N-,O-,R-,S+,V+,X-} {The switch directives}
{$M 16384,0,655360} {The memory size directives}
Compiler directives can be set locally within the program and then reset
when required, so that {$I-} switches input/output checking off and then
{$I+} switches it back on again.
Alternatively, the default values can be changed by choosing the Options
Menu in the Integrated Development Environment (IDE) and then selecting
Compiler from the sub-menu. A dialog box is then displayed and each option
can be toggled by means of the space bar. Successive option are selected
by using the arrow keys, whilst movement to the different sub-boxes is
achieved by using the tab key. Conditional defines can also be entered.
There are three types of directives:
Switch Directives.
------------------
These turn particular compiler features on or off by specifying + or -
immediately after the directive name.
e.g. {$R-} {Turn off range-checking}
Parameter Directives.
---------------------
These specify parameters that affect the compilation, such as file names
and memory sizes.
e.g. {$I filename} {Include the named file in the compilation}
{at this point in the current program. }
Conditional Directives.
-----------------------
These control conditional compilation of parts of the source text, based
on user-definable conditional symbols.
e.g. {$DEFINE Debug} {Defines Debug}
{IFDEF Debug} {If debug defined, as above, then the program
........ statements located in the lines up to the
........ final directive are compiled}
{$ENDIF} {Ends the conditional directive}
Compiler directives are described in detail in Chapter 21 (pages 261 - 280)
of the Programmer's Guide (version 6.0).