Skip to content

NextSelectedRowId - dbList_

Returns the next selected RowId

Type: Function
Return Data Type: RowID

Parameters

Parameter Type Description
bClear Integer If true, the RowId is removed from the list of selected items

Syntax

Function NextSelectedRowId Integer bClear Returns RowID

Call Example

Get NextSelectedRowId bClear to RowIDVariable

Description

Returns the next selected RowId. This is typically used with multi-select dbLists (Select_Mode = Multi_Select).

You should always use Init_Selected_Item before you start your enumeration. If you do not, your enumeration will start at an unknown position.

Sample

Object oButton is a Button
    ...

    Procedure OnClick
        RowId[] myRowIds

        Get GetAllSelectedRowIds of oSelList to myRowIds
    End_Procedure

End_Object  // oButton

Object oSelList is a dbList
    ...

    Function GetAllSelectedRowIds returns RowId[]
        RowId riMyRowId
        RowId[] myRowIds
        integer iCount

        Send Init_Selected_Item
        Get FirstSelectedRowId to riMyRowId

        While not (IsNullRowId(riMyRowId))
            Get NextSelectedRowId True to riMyRowId
            If not (IsNullRowId(riMyRowId)) begin
                Move riMyRowId to myRowIds[iCount]
                Increment iCount
            End
        End

        Function_Return myRowIds
    End_Function

End_Object  // oSelList

Return Value

The next selected RowId