Hello,
Does gpc support initialisation section like:
unit <name> interface implementation
Begin{initialisation} end.
Regards, Anuradha
-- S.Anuradha Generic Data Tools, Alcatel Chennai. Alcanet : 2-757-7123
On Wed, Jun 27, 2001 at 06:22:20PM +0530, Anuradha wrote:
Does gpc support initialisation section like:
Short: Yes.
Long: Try this out:
t.pas ===== program foo; uses myunit; begin end.
myunit.pas ==========
unit myunit; interface implementation begin writeln('hello world') end.
Eike
Anuradha wrote:
Hello,
Does gpc support initialisation section like:
unit <name> interface implementation
Begin{initialisation} end.
Yes an also initialisation and finalization
unit <name> interface implementation
to begin do begin <initialisation> end;
to end do begin <finalization> end; end.
On Wed, 27 Jun 2001, Anuradha wrote:
Does gpc support initialisation section like:
unit <name> interface implementation
Begin{initialisation} end.
I used it sometimes, so it works, even with no compatibility switches on. Do you have any example where it doesn't compile or make the initialization properly? Regards,
Adam Naumowicz
-------------------------------------- WWW: http://math.uwb.edu.pl/~adamn/ --------------------------------------
On Wed, 27 Jun 2001, Eike Lange wrote:
On Wed, Jun 27, 2001 at 06:22:20PM +0530, Anuradha wrote:
Does gpc support initialisation section like:
You can also pass initialisation parameters from the command line:
t.pas
program foo; uses myunit; begin end.
myunit.pas
unit myunit; interface implementation
to begin do if paramcount > 0 then writeln( paramstr(1)) else
writeln('hello world'); end.
But not from the main program: "to begin do" dosen't work there, (should it?) and the body of the main occurs after the "to begin to".
Russ
Hello,
Thankyou all for your response. The problem was , i was compiling a unit with '-c' option and it said the units used in it were not found. so i gave --automake .It was working fine till i corrected all the errors it showed.At last it gave me a set of errors like"init_<unitname> not found " and all that.I removed the init section and it worked. Now after you confirmed that it works fine, i tried comipling the already compiled source(compiled with --automake with those errors) with -c option and it compiled fine. This forces me into understanding it as i am supposed to comiple with --automake first for comipling all the units called and then again comiple with -c to finally get the .o file of a unit.
Is it so? Regards, Anuradha
Anuradha wrote:
Hello,
Thankyou all for your response. The problem was , i was compiling a unit with '-c' option and it said the units used in it were not found. so i gave --automake .It was working fine till i corrected all the errors it showed.At last it gave me a set of errors like"init_<unitname> not found " and all that.I removed the init section and it worked. Now after you confirmed that it works fine, i tried comipling the already compiled source(compiled with --automake with those errors) with -c option and it compiled fine. This forces me into understanding it as i am supposed to comiple with --automake first for comipling all the units called and then again comiple with -c to finally get the .o file of a unit.
Is it so?
If you compile a main with the --automake option you get both the executable of the main and the .o of all units used. Compilation with -c is very seldom useful to compile a pascal program. That is the C way. Maurice
On Thu, 28 Jun 2001, Anuradha wrote:
This forces me into understanding it as i am supposed to comiple with --automake first for comipling all the units called and then again comiple with -c to finally get the .o file of a unit.
Is it so?
you can do it in one step:
gpc -c --automake foo.pas -------------- foo.pas
unit foo; interface implementation uses fud; begin end. -------------- fud.pas
unit fud; interface implementation begin end.
Russ