Skip to main content
Version: 11.2

Rows.index()

note

This article is about the index() function of the Rows object.

Rows.index()​

Gets the index value in its corresponding row set of the first row in the Rows object.

Returns an integer. The index is 0-based: the first item has index 0, not 1. Returns -1 if no record is available.

Syntax​

$.udb( *ds* ).rows( [rowRef1], [rowRef2] ).index()
$.udb( *ds* ).rowSet( *rowSet* ).rows( [rowRef1], [rowRef2] ).index()

The required ds parameter is a data source selector.

The optional rowSet parameter is a rowset identifier. If the .rowSet() clause is omitted, then .rowSet('current') is assumed.

The optional rowRef1, rowRef2 are row selectors. If omitted, all records in scope are addressed.

Example​

let ri = $.udb('EMP').rows('current').index();

Example result:
22