next up previous contents
Next: Locate a Particular Instance Up: The Trybos Project User's Previous: Modifiers and Iteration

Tasks involving Record Iteration

There are just a few steps to using record iteration to perform common software tasks. First, one must initialize the record iterator variable. This is often equivalent to calling BLOCAT() when using YBOS. Then one should always test for validity if the iterator is expected to point to a bank, to be sure that it is in fact pointing to a bank. This is equivalent to testing the status code returned from BLOCAT() when using YBOS. Finally, one can attempt to find the next bank of any bank name (TRY_Record_Iter_Any) or of the same bank name (TRY_Record_Iter_Same) using one of the iteration methods. This is roughly equivalent to calling BNEXT() and BDATA() when using YBOS.

As simple as that may sound, a few examples of common programming tasks involving record iterators may prove enlightening. There are afterall a number of means to accomplish each of these three steps depending on the task at hand.





Robert Kennedy
Mon Jul 28 13:23:28 CDT 1997