Xref: utzoo comp.lang.pascal:3865 comp.sys.mac.programmer:16296 Path: utzoo!attcan!uunet!saxony!dgil From: dgil@pa.reuter.COM (Dave Gillett) Newsgroups: comp.lang.pascal,comp.sys.mac.programmer Subject: Re: Handle to a linked list Message-ID: <280@saxony.pa.reuter.COM> Date: 29 Jul 90 09:50:42 GMT References: <1723MAYER-A@RICEVM1> Organization: Reuter:file Inc (A Reuter Company) Palo Alto, CA Lines: 19 In <1723MAYER-A@RICEVM1> MAYER-A@RICEVM1.BITNET (David Mayer) writes: >I need a handle to the entire list. It seems like I could get a handle the >first record, copy that block elsewhere and append each subsequent record >as a block to that one. This seems like a complicated solution, though. >Anyone know of an easier way??? It sounds like what you really want to do is to convert the list to an array; convert the separate items on the list into a single block that contains the entire list. (A nosy part of me has to wonder why. The only advantage I can see to it is to use array indices to jump directly to the Nth item on the list, and your phrasing suggests that's not what you have in mind. So maybe the correct question is: What kind of linked list is it, if a handle to the first item is different from a handle to the entire list??? Think this one through.) Assuming that's what you want to do, I'm pretty sure there's a Toolbox routine that will tack a second handle's contents onto the end of a first handle's, shuffling the blocks around for you. I think you still have to deallocate the old handle yourself, but basically walking the list is all the code you need. Dave