RowCount

Description

Obtains the number of rows that are currently available in a DataWindow control or DataStore. To determine the number of rows available, the RowCount method checks the primary buffer.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore object


Syntax

PowerBuilder

long dwcontrol.RowCount ( ) 

Argument

Description

dwcontrol

A reference to a DataWindow control, DataStore, or child DataWindow


Return value

Returns the number of rows that are currently available in dwcontrol, 0 if no rows are currently available, and -1 if an error occurs.

If dwcontrol is null, in PowerBuilder and JavaScript the method returns null.

Usage

The primary buffer for a DataWindow control or DataStore contains the rows that are currently available for display or printing. These are the rows counted by RowCount. The number of currently available rows equals the total number of rows retrieved minus any deleted or filtered rows plus any inserted rows. The deleted and filtered rows are stored in the DataWindow's delete and filter buffers.

Examples

This statement returns the number of rows currently available in dw_Employee:

long NbrRows
NbrRows = dw_Employee.RowCount()

This example determines when the user has scrolled to the end of a DataWindow control. It compares the row count with the DataWindow property LastRowOnPage:

dw_1.ScrollNextPage()
IF dw_1.RowCount() = Integer(dw_1.Describe( &
         "DataWindow.LastRowOnPage")) THEN
      ... // Appropriate processing
END IF

See also

DeleteRow

DeletedCount

Filter

FilteredCount

InsertRow

ModifiedCount

SetFilter

Update