CCL Home Page
Up Directory CCL gchoice
#include "utility.h"

int gchoice(prompt,choices,null_ok,choice)
/*============================================================================*/
/* PURPOSE: GET A ONE CHARACTER CHOICE FROM THE USER.  CASE IS IMMATERIAL
/*	SINCE THE SUPPLIED CHOICES ARE UPPERCASED.
/* INPUTS:
/*	PROMPT		PROMPT STRING TO BE DISPLAYED FOR USER.
/*	CHOICES		LIST OF VALID ONE CHARACTER CHOICES.
/*	NULL_OK		TRUE/FALSE IF NULL ENTRY IS VALID.
/* OUTPUTS:
/*	CHOICES		UPPERCASED LIST OF CHOICES.
/*	CHOICE		VALID UPPERCASE ONE CHARACTER CHOICE IF SELECTED.
/*	FUNCTION VALUE	STATUS OF USER RESPONSE (AS IN UTILITY.H).
/* WRITTEN: M.V.GRIESHABER
/* LAST MODIFICATION: 11 JUNE 1991 MVG
*/
   char prompt[];
   char choices[];
   int null_ok;
   char *choice;
   {
   char response[100];	/* USER INPUT. */
   int status;		/* STATUS OF USER INPUT. */
   int i;		/* LOOP INDEX: WHICH CHARACTER. */

   while(TRUE)
      {
      status=gstring(prompt,null_ok,response);
      if (status==ABORT_ENTRY || status==NULL_ENTRY) return(status);

      response[0]=toupper(response[0]);
      for (i=0; i
  
Modified: Fri Feb 11 17:00:00 1994 GMT
Page accessed 4911 times since Sat Apr 17 21:58:55 1999 GMT