Hi everybody, hi African Chief!
It seems that I am no more the only one who uses Objects. :-)
According to The African Chief:
Using the latest GPC alpha (9704), I find that I cannot import objects from a unit. I originally had the source for TObject (below) in a unit, and used the unit in this program (test.pas). I had compile errors all the time.
That's strange because when I put TObject below in a separate Unit everything compiles fine. However the resulting code is buggy. :-( I will investigate this.
Did you recompile the Unit? The GPI file format changes with every new alpha GPC.
Then, I put the object's source into test.pas itself, and it compiled. But when I tried to create a descendant object (NewObj), as seen in the source below, again, I had compile errors - complaining about the "initializer element" for some of the methods not being "constant".
I see. You have detected a bug ... even two bugs. Thanks for reporting them!
Can anyone tell why this source does not compile, even with the -borland-pascal flag?
The `--borland-pascal' switch has no effect on this. You do not need to enable Objects, but vice versa, if you specify one of `--standard-pascal-level-0', `--standard-pascal', `--extended-pascal', or `--ucsd-pascal', you *disable* OOP.
Peter
Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201] maintainer GNU Pascal [970401] - http://home.pages.de/~gnu-pascal/ [970125]