Emil Jerabek wrote:
Module DemoMod3 (Output); export DemoMod3=all; procedure readenv; end; type FileNameString = string(80); var PAS_DATABASE : FileNameString;external; uses gpc;
Do not redefine the type and variable, import them:
Module DemoMod3 (Output);
Yes (and the procedure). I know, the bad influence of C ...
But apart from this, there is unfortunately a bug in gpc-2.1 which was fixed meanwhile, and which is probably the cause of the problem here:
@item 20030321: variables declared in interfaces of modules are not initialized (capacity of strings etc.) (daj3.pas, sven14c.pas, nick1.pas)
So my recommendation is to upgrade GPC. Even though the most recent releases are labelled alpha, they're not much less stable than 2.1 (probably even more stable, as many bugs, such as this one, have been found and fixed since then). The most recent one is http://www.math.uni.wroc.pl/~hebisch/gpc/gpc-20051104.tar.bz2
Side note:
PAS_DATABASE := Copy(pascalEnv,1,Length(pascalEnv))
The Copy here is a nop. Perhaps you did this in order to debug the bug above. Otherwise, you could just say PAS_DATABASE := pascalEnv.
Frank