cli_rpl()

Replaces the string for the specified item in a choice list

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

UCHAR *stp

String to put into the choice list

int item_num Row in which to replace string or APPEND_ROW to add to end
CLISTPTR clistp Choice list to operate on
Returns  
1 The item text was replaced in the choice list
0 Error. VV_ERR is set to one of the following:

  KWDNOTFOUND

ERRREAD

FILETOOBIG

MEMLACK

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.

There is insufficient memory to allocate a MFLINE structure for the new memory file line.

Description

cli_rpl() first calls mf_kwdset() to set the memory file to operate within the section marked by the choice list's keyword. mf_rowrpl() is called to replace the existing item or add a new item to the end of the choice list. mf_rowrpl() will truncate the string if it does not fit in the memory file row. If the changed item is visible within the choice list window, a flag is set to ensure that the choice list is updated.

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_rpl() was called.

Related Functions

cli_del(), cli_ins(), cl_itemq()

Cautions

The string you specify should fit within the choice list window. If it doesn't the string will be truncated. Truncation of the string is not considered an error.

No tab expansion is performed on the specified string. Therefore, do not use tab characters in this string.


Home Contents Previous Next