Dear All
Is it possible to have export clause at the end of module/program in gpc version 2.1 as my porting will becomes much easier
regards Hari
__________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com
vanam srihari kumar wrote:
Is it possible to have export clause at the end of module/program
No. In modules, it comes first in the interface, and programs do not export as all. (If you want to export something, put it in a module, not in the program.)
in gpc version 2.1 as my porting will becomes much easier
Why? Some more explanations/examples might enables us to help better.
Frank
vanam srihari kumar wrote:
Is it possible to have export clause at the end of module/program in gpc version 2.1 as my porting will becomes much easier
The compiler wants to _see_ the export clause at the beggining. You can use the proprocessor to write it at the end. Namely, insted of:
module m; export m = all; const c = 0;
end; { Module body } end .
Your can write (assuming your file is called "kumar.p"):
{$ifndef second_time} module kumar; {$csdefine second_time} {$include "kumar.p"} const c = 0;
end; { Module body } end . {$else} export kumar = all; {$endif}
If you want to write one-pass translator/generator then putting export clause in separate file may be the easiest option.