| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== CHOICE (return relative item position) ====== | [[changes return changed queue .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[choose return chosen value .htm|{{btn_next_n.gif|Next page}}]] | | || {{newc7.jpg|NewC7.jpg}} **CHOICE(** [//control//] **)** {{blk2blue.jpg|blk2blue.jpg}} | **CHOICE** | Returns a user selection number. | | //control// | A field equate label of a LIST, COMBO, SHEET, or OPTION control. | The **CHOICE** procedure returns the sequence number of a selected item in an OPTION structure, SHEET structure, LIST box, or COMBO control. With no parameter, CHOICE returns the sequence number of the selected item in the last control (LIST, SHEET, OPTION, or COMBO) that generated a Field-specific event to cycle the ACCEPT loop. CHOICE(//control//) returns the current selection number of any LIST, SHEET, OPTION, or COMBO in the currently active window. CHOICE returns the sequence number of the selected RADIO control within an OPTION structure. The sequence number is determined by relative position within the OPTION. The first control listed in the OPTION structure's code is relative position 1, the second is 2, etc. CHOICE returns the memory QUEUE entry number of the selected item when a LIST or COMBO box is completed. | **Return Data Type:** | SIGNED | **Example:** ** CODE** ** ACCEPT** **  EXECUTE ****CHOICE****() !Perform menu option** **   AddRec          !procedure to add record** **   PutRec          !procedure to change record** **   DelRec          !procedure to delete record** **   RETURN          !return to caller** **  END** ** END** **See Also:** [[list declare a window list control .htm|LIST]] [[sheet declare a group of tab controls .htm|SHEET]] [[combo declare an entry list control .htm|COMBO]] [[option declare a set of radio controls .htm|OPTION]] [[queue declare a memory queue structure .htm|QUEUE]] [[radio declare a radio button control .htm|RADIO]] [[prop selstart.htm|PROP:Selected]] [[prop choicefeq.htm|PROP:ChoiceFEQ]]