Markus Gerwinski wrote:
[snip]
Digital Pascal allows this "structure" of the code via [global]
modules, and this code worked
in the last release.
[snip]
The "real" solution would, of course, be to declare all routines in the interface of that unit which implements it, and get rid of your `env' unit.
Then, each unit can import (`uses') all other units (or only those that it actually needs) in the implementation part, so you can compile all interfaces first, then all implementations (or use GP which will do this automatically).
I happen to be porting code originally in DEC Pascal. This code has also gone via Turbo Pascal & something other thing I forget to GPC so it doesn't _quite_ apply. (In fact at some point I'm going to have to completely overhaul it as its been through one too many "quick ports" to my mind... :-) )
I'd second Franks suggestion of discarding the env unit; this is essentially how my code is structured, save for one nuisance I had to work around. For all the things declared [global] in any one module I make up a little global unit for that module, then use 'use' to bring them back in. This way they can be 'use'd by several units and maintain the overall code structure.
FWIW, this relates to 'uses inheritance' thing I raised ages ago which caused (too) much fuss. If interfaces where inherited you wouldn't have to do this, you'd just 'use' the module and that'd be it. But we've been through that and GPC doesn't do this :-)
Grant