The standard list box control provides a convenient way for a program to implement a look-up facility for a group of items.
It is also tempting to extend this type of use into a method for locating records in a data file. Unfortunately, this doesn't
work well when there are too many records in the file. The programmer runs into two main problems:
- The standard list box has a limited capacity (64K bytes), usually less than 2000 items.
- It takes too long to load the list box with the entire set of items.
Also, if the number of items is very large, the user may have a difficult time locating a particular item. There are two reasons
for this:
- The resolution of the scroll bar's slider is too coarse.
- The search mechanism is too primitive (single-character match on the first byte of the record).
The paged list box is a variation of the standard list box that solves all of these problems. A paged list box works by managing
only a limited number of records at a time. When it needs more records, it requests them from the controlling program. Paged
list boxes are intended to be used in conjunction with a large, ordered data source, typically records stored in an indexed
file.
Compared to a standard list box, a paged list box has the following advantages:
- There are no capacity limitations. Since the paged list box stores only a small number of items at once, capacity is not an
issue.
- Load time is minimized. The list box displays as soon as it receives enough items to fill its visible portion.
- There is an enhanced search facility. A paged list box can search for items based on full text strings instead of single characters.
When the paged list box is active, the user can simply begin typing a string of text. A search box pops up, displaying the
entered characters and the list box scrolls to the first entry that matches the string. You determine (with the SORT-ORDER
property) whether the search is case-sensitive or not.
- Memory requirements are minimal. Because it stores only a few items at once, a paged list box can be less of a drain on memory
than a standard list box.
The primary disadvantage of a paged list box is that it's more complicated to program. Also, it's not well suited to handling
unordered data.