Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!ucsd!ames!uhccux!webb From: webb@uhccux.uhcc.hawaii.edu (Thomas Webb) Newsgroups: comp.lang.pascal Subject: Re: Rusty programmer seeks help... Summary: Thanks everyone! This is the right answer... Message-ID: <5655@uhccux.uhcc.hawaii.edu> Date: 8 Dec 89 18:57:25 GMT References: <5651@uhccux.uhcc.hawaii.edu> <4222@hydra.gatech.EDU> Reply-To: webb@uhccux.UUCP (Thomas Webb) Distribution: usa Organization: University of Hawaii Lines: 24 Lots of people mailed me answers to my problem with the recursive directory search, and I have tried to mail responses to all of them, however, I was unable to get mail through to Bob Baggerman and Tom at the U of Tronto, and so would like to thank them here. At any rate, the sloution that Scott Bostater puts forth here is the one that I have used, and it does, indeed, work as it should. Thank you Scott. >Your problem is that the variable DirInfor is not local to your recursive >routine. What's happening is that the second call over-writes the information >in DirInfo that specifies what the filename and pathname are. By making Dirinfo >local to the procedure tree, you keep making copies of Dirinfo on the heap so >that when you return from one level of recursion, the previous data in the >old version of DirInfo is still intact. This method works fine as long as you >have plenty of heap/stack space! >-- >Scott Bostater GTRI/RAIL/RAD (Ga. Tech) >"My soul finds rest in God alone; my salvation comes from Him" -Ps 62.1 -- =============================================================================== webb@uhccux.uhcc.Hawaii.edu ===============================================================================