On Tue, Nov 15, 2005 at 02:44:28AM -0800, vanam srihari kumar wrote:
Please find below the test code I am using
- Makefile
PC=gpc PFLAGS= -DSOLARIS PLINK = -lgpc
VPATH = /home/kvsspl/
ModDemo3.o :ModDemo3.pas $(PC) --automake -c $(PFLAGS) ModDemo3.pas
DemoMod3.o :DemoMod3.pas $(PC) --automake -c $(PFLAGS) DemoMod3.pas
DemoMod4.o :DemoMod4.pas $(PC) --automake -c $(PFLAGS) DemoMod4.pas
ModDemo3 :ModDemo3.o DemoMod3.o DemoMod4.o $(PC) -o ModDemo3 ModDemo3.o DemoMod3.o DemoMod4.o $(PLINK)
clean : rm -f *.o *.out xtramain ModDemo3 *.gpi *.gpm
- DemoMod4.pas
Module DemoMod4 (Output); export DemoMod4=all; type FileNameString = string(80); var PAS_DATABASE : FileNameString; end; end.
(*Is it possible to make these variables global, without using export?*)
- DemoMod3.pas
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);
export DemoMod3=all; procedure readenv; end;
uses DemoMod4, gpc;
Please read the documentation, as you seem to misunderstand how the concept of modules is supposed to work.
Emil Jerabek