INSERTION-INDEX (numeric)

Setting this property to a positive value affects the location of the next item added to the list box. When it is set to zero (the default), items are added in sort-order, or to the end of the box if the list box has the UNSORTED style. When INSERTION-INDEX is positive, the next item added is placed immediately before the corresponding item instead. For example, setting this to 1 causes the next item to be inserted at the top of the list. You can place an item at the end of the list by specifying an index one greater than the number of items in the list. When you finish adding the next item, INSERTION-INDEX automatically resets itself to a value of zero.

In statements that allow for multiple properties, the properties are set in the order specified. Therefore, you can set both INSERTION-INDEX and ITEM-TO-ADD in the same statement, providing you specify INSERTION-INDEX first. For example, the following statement will add a new item to the top of a list box:

MODIFY LIST-BOX-1,
   INSERTION-INDEX = 1,
   ITEM-TO-ADD = "New top item"