list_colix

Gets the index of a lists's column.

Available in:

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

Syntax

int list_colix(list-name,col-name)
list           list-name
expr           col-name

Description

Returns column index; if the specified column is not found, returns -1.
list-name specifies the name of the list that contains the column to index. The list must have been created with a SELECT statement to have column names.

col-name specifies the column to index.

Example

Prints the index of the specified column in a given list.
{
 list xx, yy;

 xx = list_open("SELECT * FROM org", 1000);
 yy = list_open("20 16 10", 1000, "LMD");

 printf(list_colix(xx, "DEPTNUMB"));
 printf(list_colix(xx, "DEPTNAME"));
 printf(list_colix(yy, "DEPTNUMB"));
 list_close(xx);
 list_close(yy);
}