list_pos

Gets current position in a list.

Available in:

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

Syntax

int list_pos(list-name)
list         list-name

Description

Returns the 0-origin based current position in the list. If the list is empty, returns -1.

Example

Prints the current positions of the specified items.
{
 list xx;
 xx = list_open("20 16 10", 1000, "List1");
 printf(list_pos(xx));

 list_mod(xx, 1, "1", "2", "3");
 list_mod(xx, 1, "4", "5", "6");
 printf(list_pos(xx));
 list_close(xx);
}