Skip to content

Init_Selected_Item - PickList_

Sets enumeration_counter of selected items in a list to zero

Type: Procedure

Syntax

Procedure Init_Selected_Item

Call Example

Send Init_Selected_Item

Description

Init_Selected_Item resets the private property Enumeration_Counter to zero, thereby re-initializing the counter for the list of selected items to be enumerated in a dbList.

Send Init_Selected_Item of oMyDbList

When processing all of the items in a multi-select dbList (Select_Mode = Multi_Select), you should always: 1. Call Init_Selected_Item to start initialize the processing. 2. Call NextSelectedRowId until the item returned is -1.

Sample

Boolean bClearItem
Send Init_Selected_Item
// the bClearItem parameter determines if the item should be cleared after
// you've selected it. If you do clear it (send True), you can only traverse the list once.
Get NextSelectedRowId bClearItem to iItem
While (iItem>=0)
    Send ProcessThisItem iItem
    Get NextSelectedRowId bClearItem to iItem
End

Notes

As of DataFlex 11.0, we advise that you use the item-based methods (First_Selected_Item & Next_Selected_Item, which return items) for batch lists and the RowId-based methods FirstSelectedRowId & NextSelectedRowId, which return RowIds) for non-batch lists. This allows you to use standard tables that do not have a Recnum column. In either case, you should still send Init_Selected_Item before starting the process.

If using the item-based methods (First_Selected_Item & Next_Selected_Item) to retrieve selected items from a list, the list is a batch list (determined by Batch_State), the list's item number is returned. If the list is non-batch, the record number (Recnum) value is returned.

[/NOTE]