Making Multiple Picks from a Choice List

You can allow the user to pick several items from a choice list. To do this, you will need to (1) define an array to hold each selection as it is made, (2) display the choice list, (3) create a loop that calls cl_rd() and copies the next selection to the array until the user exits the choice list, and (4) removes the choice list from the screen.

A code example showing how to do this follows:

int selections[30];

int i = 0;

int done = FALSE;
/* Define array
*/
cl_up(clistp);
/* Display choice list

 
*/
/* While user selecting        

while (!done)

{

    if (cl_rd(0, clistp) == AC_EXIT)

    {

       selection[i++] = cl_curnum(clistp);

       if (i == 30)

          done = TRUE;

    }

    else

       done = TRUE;

}

cl_dn(clistp);
*/


Home Contents Previous Next