Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!rit!ritcv!dgr0093 From: dgr0093%ritcv@cs.rit.edu (340 Ok) Newsgroups: comp.lang.pascal Subject: Re: Pointers / Linked lists with files.. Summary: This looks moderately crazy. Message-ID: <1119@cs.rit.edu> Date: 14 May 89 16:43:37 GMT References: <5708@cs.Buffalo.EDU> <1389@bucket.UUCP> <3377@westfort.UUCP> Sender: news@cs.rit.edu Reply-To: dgr0093%ritcv@cs.rit.edu (Michelangelo H. Jones) Organization: Rochester Institute of Technology, Rochester, NY Lines: 43 In article <3377@westfort.UUCP> westfort!dragon@tut.cis.ohio-state.edu writes: > In one of my programs, I have need for several variables which are >diminsioned to an array of 100, which are declared under a Record Type.. When >I define the record and the file name in my VARS section, I'm told the >structure is too large... > >Type >mbrec=record [ big record deleted] > >Var > mb:array[1..50] of mbrec; > fm:file of mbrec; Well, I think I know why your compiler's complaining.. that record, under any Pascal I can think of, would take at least 10952 bytes (that figure for IBM Turbo Pascal). An array of 50 of 'em would take 547,600 bytes. Ten thousand bytes is an awful lot for any compiler to bite off as one chunk. Do you know how long it would take to execute the loop the compiler would generate just for a simple assignment such as mbrec1 := mbrec2; ? That's a lot of stuff to be copying around. And then you have your much larger variable mb; and you're saying you're going to be doing writes and reads of these 534K chunks, all at once. This is silly. You're asking the compiler to be doing work that you as the programmer should be doing at a higher organizational level. If that's not possible, I have 2 suggestions. 1> Look into some form of RLL encoding to shorten those strings. If you know that the compressed length of a 100 character string will never exceed 50, an array [1..100] of these just saved 5000 bytes. 2> If you only need one of these things at a time (which in this case I doubt), look into using a free union variant record. That'll significantly drop the size of each of these records. Good luck... Jones.