Skip to content

FirstSelectedRowId - dbList_

Returns the first selected RowId

Type: Function
Return Data Type: RowID

Syntax

Function FirstSelectedRowId Returns RowID

Call Example

Get FirstSelectedRowId to RowIDVariable

Description

Returns the first 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 first selected RowId