ActiveRowCount function
Syntax
ActiveRowCount(Scrollpath)
Where scrollpath is:
[RECORD.level1_recname, level1_row, [RECORD.level2_recname, level2_row, ]] RECORD.target_recname
To prevent ambiguous references, you can use SCROLL. scrollname, where scrollname is the same as the scroll level’s primary record name.
Description
Use the ActiveRowCount function to return the number of active (non-deleted) rows for a specified scroll area in the active page.
Note:
This function remains for backward compatibility only. Use the ActiveRowCount Rowset class property instead.
ActiveRowCount is often used to get a limiting value for a For statement. This enables you to loop through the active rows of a scroll area, performing an operation on each active row. Rows that have been marked as deleted are not affected in a For loop delimited by ActiveRowCount. If you want to loop through all the rows of a scroll area, including deleted rows, use TotalRowCount.
Use ActiveRowCount with CurrentRowNumber to determine whether the user is on the last row of a record.
Parameters
| Parameter | Description |
|---|---|
|
scrollpath |
A construction that specifies a scroll level in the component buffer. |
Returns
Returns a Number value equal to the total active (non-deleted) rows in the specified scroll area in the active page.
Example
In this example ActiveRowCount is used to delimit a For loop through a level-one scroll:
&CURRENT_L1 = CurrentRowNumber(1);
&ACTIVE_L2 = ActiveRowCount(RECORD.ASSIGNMENT, &CURRENT_L1, RECORD.ASGN_HOME_HOST);
&HOME_HOST = FetchValue(RECORD.ASSIGNMENT, &CURRENT_L1,
ASGN_HOME_HOST.HOME_HOST, 1);
If All(&HOME_HOST) Then
For &I = 1 To &ACTIVE_L2
DeleteRow(RECORD.ASSIGNMENT, &CURRENT_L1, RECORD.ASGN_HOME_HOST, 1);
End-For;
End-If;
Related Topics