Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!unido!rwthinf!cip-s01!pmk From: pmk@cip-s01.informatik.rwth-aachen.de (Michael Keukert) Newsgroups: comp.lang.pascal Subject: Re: Turbo Pascal absolute variables crossing units Keywords: absolute variables units Borland Turbo Pascal TP4.0 Message-ID: <2013@rwthinf.UUCP> Date: 20 Jan 90 02:45:54 GMT References: <3757@mit-caf.MIT.EDU> Sender: news@rwthinf.UUCP Reply-To: pmk@cip-s01.UUCP (Michael Keukert) Organization: Informatik RWTH Aachen Lines: 38 In article <3757@mit-caf.MIT.EDU> the@mit-caf.UUCP (Siang-Chun The) writes: > > unit outer; > interface > var > status : integer absolute inner.stat; > implementation > (* > * details.. > *) > end. > Try instead: UNIT outer; INTERFACE CONST status:INTEGER = inner.stat; IMPLEMENTATION Doing this, you declare outer.status as a typed constant which means, this is a "normal" variable but with a defined value within the code. ABSOLUTE is only valid with a memory-adress for example VAR somewhere_in_memory ABSOLUTE $c000:0000; which means, that the variable somewhere_in_memory contains always the value in memory-cell $c000:000. OK? -------------------------------------------------------------------------- Michael Keukert, Elsasstrasse 58, D-5100 Aachen 35, Phone: +49 241 513297 Twenty bucks per day plus expenses, hundred in advance. (Sam Spade)