Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-unix!hplabs!hpcea!hpfcdc!hpfcrj!steve From: steve@hpfcrj.HP.COM (Steve Taylor) Newsgroups: comp.sys.hp Subject: Re: HP Basic linked lists? Message-ID: <4680003@hpfcrj.HP.COM> Date: Tue, 3-Mar-87 15:35:29 EST Article-I.D.: hpfcrj.4680003 Posted: Tue Mar 3 15:35:29 1987 Date-Received: Sat, 7-Mar-87 23:41:53 EST References: <1084@phred.UUCP> Organization: HP Ft. Collins Lines: 25 One additional note: If you want to use MAT SORT to compact the data for output, but wish to use linked lists for updating the data, you can combine the two methods. The main problem would be all the links becoming invalid when the data is moved by the sort. While it would be possible to fix-up the links from the REORDER vector, it might be simpler to just put the array back the way it was after the OUTPUT. (I'll assume the pointers are in a separate array and the primary sort field has a bound that can be used to flush unused entries to the end.) First, MAT SORT Data_array TO R_vector then MAT REORDER Data_array BY R_vector Next determine the valid size, REDIM, OUTPUT, REDIM to original size, and now to recover: FOR I=1 TO Upper_bound Restore_vector(R_vector(I))=I NEXT I MAT REORDER Data_array BY Restore_vector and everything should be back where it was. I'm assuming (also) that you'll set up the links from scratch when you read the data back in from the file. Good luck with your application. Regards, y-s-t---w t-i Steve Taylor / / \ \ / \ [hpfcla!steve-t] S-O-f e-r-a o-n \ / \ \ p m-s r-e <>