Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!cica!iuvax!maytag!watstat!dmurdoch From: dmurdoch@watstat.waterloo.edu (Duncan Murdoch) Newsgroups: comp.lang.pascal Subject: Re: Problem with constants in Turbo Pascal unit Message-ID: <1916@maytag.waterloo.edu> Date: 7 Apr 90 12:47:33 GMT References: <90096.105600TBC101@psuvm.psu.edu> Sender: daemon@maytag.waterloo.edu Reply-To: dmurdoch@watstat.waterloo.edu (Duncan Murdoch) Organization: U. of Waterloo, Ontario Lines: 17 In article <90096.105600TBC101@psuvm.psu.edu> TBC101@psuvm.psu.edu (TomShark Collins) writes: >I'm having a problem with Turbo Pascal 5.5 and it's inclusion of >constants in my programs. I have a unit (Fonts) that contains 12 >constants (arrays 4k in size). When I just have 'Uses Fonts' in one of >my programs, everything is ok, it doesn't link the fonts. If I use any >reference to just one of the fonts, all are included in the compiled >program. My questions are 'Why?' and 'How do I get Turbo to not include >fonts not used?' In TP 5+, if you put typed constants in separate const blocks, the linker decides individually whether to include them. If they're in the same block, they all get included together. The same rule applies to global variables: put them in separate var blocks if not all of them are always needed. (This is mentioned under "smart linking" in the reference guide.) Duncan Murdoch in separate