Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!swrinde!kent From: kent@swrinde.nde.swri.edu (Kent D. Polk) Newsgroups: comp.lang.pascal Subject: Re: Pointers.. Message-ID: <16969@swrinde.nde.swri.edu> Date: 1 Jun 89 17:29:23 GMT References: <3398@westfort.UUCP> <8835@phoenix.Princeton.EDU> Reply-To: kent@swrinde.UUCP (Kent D. Polk) Organization: Southwest Research Institute, San Antonio, Texas Lines: 31 In article <8835@phoenix.Princeton.EDU> kpfleger@phoenix.Princeton.EDU (Karl Robert Pfleger) writes: [...] >repeat > write (f,t^.info); s:= t; <--------- > t:=t^.next; dispose (s); <--------- > until t=nil; (or whatever tail node you use) Unless you are exiting & expect Pascal to release your dynamically allocated memory, you might want to dispose of it explicitly. Otherwise ... :^) Also, don't forget your header (and maybe trailer) nodes. >Reading in a disk file to a linked list is just as simple. [...] > As long as you know which order the data >was saved in, you can load it back. A couple possibilities for binary >trees exist. [...] > The routines for >loading these things will, of course, be more complicated. The easiest Why not use the Insert routines which created the list in the first place? That's the easiest, especially when you have multiple indexed links to the data or a tree which can be created differently based on what you want to do with it. > - KPfleg Kent Polk