Re: C-ISAM reestablish position
Posted in 1994
Wayne Williams (compus@mv.com) wrote: : I'm using the C-ISAM library and have been unable to determine a method of : saving and restoring the current positioning within a file. I want to traverse : a file by key, but be able to "reposition" at a known point in the file where : the program had previously read - and resume traversal (by key) at that point. : I know I can save isrecnum and read a record directly by record number but : there does not appear to be a way to set the positioning in the file back to a : given record number or address so that subsequent keyed access would proceed : from that point. The file may have (many) duplicate keys, so repositioning by : doing a key lookup is not a good solution for me. : Has anyone encountered (& resolved) a similar need? Well, the obvious answer is to open another descriptor on the same file, whenever you need to "save" your current position. Then close the new descriptor and resume using the old one when you need to "restore". This technique clearly has drawbacks--file descriptors are a limited resource and there is some overhead with the extra open/close. I'd say this is probably not usable if you need more than a couple save/restore levels. Sorry I didn't have a better answer. You described what I believe is a well-known limitation of C-ISAM. I have no idea if the newer (5.x) products can improve on this or not. : Roy Hasselman : Compusense, Inc. -- Jeffrey Sturm jsturm@garnet.msen.com