Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!agate!shelby!portia!dhinds From: dhinds@portia.Stanford.EDU (David Hinds) Newsgroups: comp.lang.pascal Subject: Re: Turbo Pascal absolute variables crossing units Summary: There's an easier way, isn't there? Keywords: absolute variables units Borland Turbo Pascal TP4.0 Message-ID: <8405@portia.Stanford.EDU> Date: 19 Jan 90 22:47:20 GMT References: <3757@mit-caf.MIT.EDU> Sender: David Hinds Organization: Stanford University Lines: 16 In article <3757@mit-caf.MIT.EDU>, the@mit-caf.MIT.EDU (Siang-Chun The) writes: > I have one Turbo Pascal unit that I want to completely hide within > another unit. The inner unit to be hidden has an automatically updated > status variable that I want to be accessible to users of the outer unit. Your example might fail because references to addresses in other units can't be resolved in a unit's interface section. Though it wouldn't serve your purpose, you could see if the compiler dies when the declaration is in the implementation part of the unit. Simple workarounds would be to declare a pointer in the outer unit interface section which the body of the unit sets to point to the status variable in the inner unit. Or you could declare a parameterless function in the outer unit, which just returns the value of the status variable. - David Hinds dhinds@portia.stanford.edu