cli_txtnum()

Returns the item number corresponding to the specified text in a choice list

Call  
#include <vv_clist.h>
int cli_txtnum(stp, clistp)

UCHAR *stp

Pointer to the string to search for

CLISTPTR clistp Choice list to search
Returns  
>=0 The number of the matching item in the choice list
1 The text was not found or an error occurred. If an error occurred, VV_ERR is set to one of the following:

  KWDNOTFOUND

ERRREAD

FILETOOBIG

The keyword marking the choice list was not found in the memory file.

An error occurred while trying to read the memory file.

The keyworded section used by the choice list is too large to fit in the memory file.

Description

cli_txtnum() first calls mf_kwdset() to set the memory file to operate within the section marked by the choice list's keyword. The specified text is searched for, using a linear search. At most, the number of characters in the highlight bar are compared for a match. If a match is found, the item number at which the first match is found is returned.

If a keyword was set prior to calling this function, the memory file is restored so that it operates on the keyworded section that was active when cli_txtnum() was called.

Related Functions

cli_numtxt()


Home Contents Previous Next