Adds an item to a choice list
| Call | ||
| #include <vv_clist.h> | ||
| nt cli_ins(stp, item_num, clistp) | ||
|
UCHAR *stp |
Item text to insert into the list |
|
| int item_num | Item number to make new item or APPEND_ROW to add to end | |
| CLISTPTR clistp | Choice list to add item to | |
| Returns | ||
| 1 | The item was added to 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_ins() first calls mf_kwdset() to set the memory file to operate within the section marked by the choice list's keyword. mf_rowins() is called to add a new row containing the specified string in the memory file. If the new item is inserted preceding the current active item, the number of the current active item in the choice list structure is incremented so that the item remains current. In addition, the origin of the memory file in the choice list window and the choice list window's virtual cursor are adjusted to ensure that the highlight bar lies on the same item after the insertion. If an item is added to a choice list that has no items, the new item is made the current item. If the inserted item is visible within the window, a flag is set to ensure that the choice list is updated on the screen. 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_ins() was called. |
||
| Related Functions | ||
| Cautions
No tab expansion is performed on the specified string. Therefore, do not use tab characters in this string. |
||