When the iterator object is created, its current position is set to the first object in the list that matches the search criteria. The figure below illustrates a virtual list and some of the possible positions for the iterator object.
Figure 1-1 Virtual List with Iterator Object Possible Positions
The numbers (0, ~500, 1000, and 1001) on the left side of the list represent logical positions in the list, not actual entry numbers. A logical position is a scaled number from 0 to 1000 and not an exact index number into the list. For example, 500 represents the approximate middle of the list, whether there are actually 50 or 5,000 entries in the list.
Three positions are exact:
Logical position DS_ITR_FIRST (0) always corresponds to the first entry.
DS_ITR_LAST (1000) always corresponds to the last entry in the list.
DS_ITR_EOF (1001) indicates the end of list position, one beyond the last entry.
The position can be set to any entry in the list, or to EOF (end of file). EOF is an imaginary position after the end of the last entry. The following functions set the position or return information about the current position.