Programming tools / The preprocessor |
The &include directive instructs the preprocessor to include a file.
&include "filename"
The included file will be scanned and processed before continuing with the rest of the current file.
First line &include "B" Third line
Second line
& 1 "A" First line & 1 "B" Second line & 3 "A" Third line
These preprocessor directives inform the compiler of its current location with special preprocessor comments, so the compiler can provide the right error message when a syntax error occurs.
& number "filename"
where:
Recursive inclusions are not allowed. Doing so will fail and output an error message.
The following example is incorrect:
&include "B"
HELLO &include "A"
B.4gl:2:1:2:1:error:(-8029) Multiple inclusion of the source file 'A'.
Including the same file several times is allowed:
&include "B" &include "B" -- correct
HELLO
& 1 "A" & 1 "B" HELLO & 2 "A" & 1 "B" HELLO