Progress
Programming
Handbook
Attributes and Methods
At run time, a procedure can set or query selection list attributes to accomplish the following:
- Change the delimiter Progress uses in a multiple selection list to separate the values stored in the SCREEN–VALUE attribute. Do this with the DELIMITER attribute.
- Display all list items in sorted order by setting the SORT attribute.
- Change the size of the list with the INNER–CHARS or INNER–LINES attributes.
- Change the contents of the list with the LIST–ITEMS attribute.
- Change the selection policy of the list with the MULTIPLE attribute, but only before the selection list is realized.
- Change the DRAG–ENABLED attribute to allow or disallow the user selecting items by dragging over them with the mouse. You can change this attribute only before realization.
- Query the total number of items in the list with the NUM–ITEMS attribute.
In addition to attributes, the selection list also supports methods that allow a procedure to:
- Add an item to the beginning or end of the list with the ADD–FIRST( ) or ADD–LAST( ) methods.
- Delete an item (by value or index) with the DELETE( ) method.
- Insert an item or delimiter-separated item list (by value or index) with the INSERT( ) method.
- Replace an existing item (by value or index) with a new item (or delimiter-separated item list) with the REPLACE( ) method.
- Retrieve the item specified by an index with the ENTRY( ) method.
- Return the index of a specified item with the LOOKUP( ) method.
- Query whether an item is currently selected with the IS–SELECTED( ) method.
- Scroll an item to the top of the list with the SCROLL–TO–ITEM( ) method.
For example, the following procedure reads filenames into a selection list and uses the LIST–ITEMS attribute to change the contents of the list dynamically. To compare it with a similar procedure using a combo box, see the
p-combo2.p
procedure in the "Combo Boxes" section:
This code allows you to select from a selection list of all the files and subdirectories within the specified directory. The
DLC
directory is the initial directory. The following screen appears:
![]()
When you double-click on an item in the list (or press RETURN in character mode), the DEFAULT–ACTION trigger executes. If the item is a file, the trigger displays your access to that file. If the item is a directory, the trigger rebuilds the selection list with the contents of that directory.
Note that within the internal procedure, build–list, the list of file and directory names is built first, and then the LIST–ITEMS method is used to change the contents of the selection list. You could use the ADD–LAST( ) method within the REPEAT loop to add items to the selection list one at a time, but using LIST–ITEMS once is more efficient.
For more information on each attribute and method, see the Progress Language Reference .
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |