You can sort the items in a choice list by alphabetical order. You can do this any time after the memory file is created. If you do this after the choice list is displayed by the user or by the system, you must update the choice list on the screen.
Sorting also causes the menu items to be renumbered to correspond to their new positions in the choice list.
Sorting of choice lists is accomplished by using the memory file sort routine, mf_sort():
|
||
|
|
|
|
|
|
By specifying the keyword, you can sort only that keyword section of the memory file. If your memory file is filled with keyworded sections and you want to sort each section individually, specify NULLP for kwdp. Note that changes are made to the choice list memory file, not to the keyworded text file on disk.
Caution: In order for a memory file to be sorted within each keyword, the first character on the first row and first column of the memory file must be the keyword character. Also, special restrictions apply when sorting a choice list that is built in code rather than read from a disk file, and when sorting a choice list that uses automatic keyword loading. See Chapter 45, "Creating and Viewing Memory Files," for complete information.