Logic flow of processing a list of entries
When you process a list of entries returned by a list API, do not statically encode the values. Use the offset, the length of each entry, and the number of entries so that applications are compatible with future releases.
This is the logic flow for processing a list that contains multiple entries:
*------------------------*
| |
| Initialize the next |
| entry with 'Where |
| the list begins' |
*------------*-----------*
|
V
*------------------------*
| |
| Have all of the | YES
*------->| entries been *-------*
| | processed? | |
| *------------*-----------* *
| |NO List is
| V complete
| *------------------------*
| | |
| | Access the entry. Use |
| | the next entry value |
| | as an index. |
| *-----------*------------*
| |
| V
| *------------------------*
| | Process |
| | the |
| | entry |
| | |
| *------------*-----------*
| |
| V
| *------------------------*
| | |
| | Add the length of |
| | each entry |
| | to the next entry |
| *------------*-----------*
| |
| V
| *------------------------*
| | Add 1 to a count of |
| | how many have |
| | been processed |
| | |
| *------------*-----------*
| |
| |
*---------------------*