Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

IBM i and CPF operating system restrictions prevent logic like the following example from ever working correctly on two (or more) browse lists:

     SELECTLIST NAMED(#LIST01)
<< process LIST01 entry >>

...

                SELECTLIST NAMED(#LIST02)

           << process LIST02 entry >>

...

                << process LIST02 entry >>
          UPD_ENTRY  IN_LIST(#LIST02)

...

                ENDSELECT
UPD_ENTRY IN_LIST(#LIST01)

...

              ENDSELECT

The reason is that all browse lists belong to the same "file" (ie: display file) and therefore the update implicitly attempts to update the last "record" processed in the "file". If a program like this example was compiled, it would fail on the UPD_ENTRY command to #LIST01 with an error indicating an update was attempted "without a prior read".

...

This restriction can usually be overcome by altering the point at which the update operation is performed like this:

  

...

   SELECTLIST NAMED(#LIST01)

...

     << process LIST01 entry >>
=> UPD_ENTRY IN_LIST(#LIST01)

...

                SELECTLIST NAMED(#LIST02)

              << process LIST02 entry >>

...

                << process LIST02 entry >>
              UPD_ENTRY  IN_LIST(#LIST02)

...

                ENDSELECT

...

     ENDSELECT

If a solution like this cannot be implemented, use a GET_ENTRY command immediately before the UPD_ENTRY command.

...