list_next

Reposition to the next item in the list.

Available in:

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

Syntax

int list_next(list-name)
list          list-name

Description

Increments the current list pointer for the list, if possible. Returns the current position in the list. You can also use the ++ operator on the list variable to advance the position however this will not return the new position number.

Example

Useful as part of the default trigger code for the down-arrow key:
{
int rows,pos;
pos = list_pos(p.wl);        /* remember current position */
if (list_next(p.wl) != pos) { /* did we move? */
.
.
}
In a for loop, the ++ operator is useful since you do not need the new position returned;
{
list ll;
int i;
ll = list_open("select * from staff",1000);
for (i=list_rows(ll);i;i--,ll++) {
  .
  .
  }
}