active_row

Sets the active row of a multi-record window.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL
X X      

Syntax

int active_row([row])
int             row

Description

Always returns the active row number, which has been stored in the window-name.AR variable.
row (optional) specifies a new active row. You can specify the row by its count. If row's value exceeds the window row repeat count, the function assumes the row with the highest count. If you don't specify row, the function returns the existing (current) row.

Notes

Use active_row() when you need the active row of the current window. Use window-name.AR when you want the active row of a specific window.

Example

Calculates the number of rows in the window and moves the data from the list to the window.
{
int  i,ari,pos,rows;

ari  = active_row();
pos  = list_pos(p.wl);
rows = active_row(99999);

for (i=0;i<=rows;i++) {
 active_row(i); move_l2f();
 field_exec(uat_calc,true);
 if (list_pos(p.wl) == list_next(p.wl)) break;
 }
for (i++;i<=rows;i++) { active_row(i); field_set(NULL); }

active_row(ari);
}