Setting the Item to be Current When the Choice List Is Activated

The first time the choice list is displayed, the default is for the first item in the choice list (item 0) to be the current item. If the choice list is displayed again, the default is for the last item selected to be the current item. You can change the item that is highlighted when the choice list is displayed.

Designer: In the Designer, you can specify the item to be current the first time the list is displayed. If you want to change the current item when the choice list is displayed for the second and subsequent times, use the function scl_curnum() in your code.

Code: You can change the item that is highlighted when the choice list is displayed by calling the set choice list current item number function, scl_curnum():

void scl_curnum(item_num, clistp)

int item_num;        /* Item number to make current        */

CLISTPTR clistp;    /* Pointer to choice list            */

In our sample program, cl_data.c, FXO is the fourth item in the shipping code choice list. To make FXO the item that is highlighted when the user enters the shipping code choice list, use the following call:

scl_curnum(3, fld_clistp(ship_fldp));

where ship_fldp is a pointer to the field to which the choice list is attached. Note that choice list items are numbered from zero.


Home Contents Previous Next