list_find

Searches a list.

Available in:

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

Syntax

expr list_find(list-name,col,target[,col,target,...][,direction])
list           list-name
int            col
expr           target
int            direction

Description

Searches a list and sets item pointer to first position that meets criteria. Returns first target. Otherwise returns NULL.
list-name specifies list to search.

col specifies column(s).

target specifies criteria in specified column(s).

direction (optional) specifies the direction from current position (starting with current position) in which to search.
  • -1 --- backwards.
  • 1 --- forwards.
  • 0 --- from first item in list. (Default)

Example

Searches parts list for specific part.
{
if (list_find(xx,1,"crankshaft") == NULL)
 printf ("No crankshaft found in list");
}