> If I am reading down a chain and updating the values for that chain's
> search item, what happens to the chain information? For instance, this
> program does a chained read by a certain value, and replaces the value for
> that search item with zeroes. Can I do:
>
> DBFIND
>
> DBGET (chain forward)
>
> DBUPDATE (with new value)
>
> Go back to DBGET until end of chain is reached
>
> Or will the program "lose its place" on the chain because of the changing
> search item values? If so, then I suppose I will have to save the value of
> the next record on the chain and get that record by address, instead of by
> chained read, so the processing logic would look like this:
>
> DBFIND
>
> DBGET (chain forward)
>
> Save next record address
>
> DBUPDATE (with new value)
>
> DBGET (by direct record address)
>
> Go back to the "Save" until there is no next record.
>
> On a related note, if I am reading down chain A and changing values for
> chain B's search item, what happens to the chain information? Can I do
> what I outlined above in the first logic example, or will I need to keep
> track of the chain information in the program, as in the second example?
>
> As always, any and all help is appreciated.
>
> Jim Phillips Manager of Information Systems
> E-Mail: [log in to unmask] Therm-O-Link, Inc.
> Phone: (330) 527-2124 P. O. Box 285
> Fax: (330) 527-2123 Garrettsville, Ohio 44231
Hi,
When you do DBUPDATE (with CIUPDATE), TurboIMAGE internally handles the
chains. It internally does a re-read to establish the current updated entry
and the chain. You can use the steps as in your first example without any
problem. Also refer Chapter-4 of TurboIMAGE manual, sub-heading 'Updating Key,
Search and Sort items' for a discussion of appropriate dbopen, dbcontrols etc.
Hope this helps
--
Regards,
Vikram
Vikram Kumar B T,
Hewlett Packard India Software Operations Ltd
29 Cunningham Road, Bangalore 560 052, India
|