RowCount method (DataWindows)
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.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
Web |
Client control, server component |
Web ActiveX |
DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder and Web DataWindow server component]
1 |
long <span>dwcontrol</span>.<span>RowCount</span> ( ) |
[Web DataWindow client control and Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>RowCount</span> ( ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control, |
Return Values
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:
1 |
long NbrRows |
1 |
NbrRows = dw_Employee.<span>RowCount</span>() |
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:
1 |
dw_1.ScrollNextPage() |
1 |
IF dw_1.<span>RowCount</span>() = Integer(dw_1.Describe( & |
1 |
"DataWindow.LastRowOnPage")) THEN |
1 |
... // Appropriate processing |
1 |
END IF |