Menu Program Menu Program This program displays a menu of operations from which an operator can choose. Features Introduced l Subroutines l Local variables l Terminal interaction with operator l String variables l WHILE and CASE structures Program Listing .PROGRAM sub.menu() ; ABSTRACT: This program provides the operator with a menu of ; operation selections on the system terminal. After accepting ; input from the keyboard, the program executes the desired ; operation. In this case, the menu items include execution of ; the pick and place program, teaching locations for the pick ; and place program, and returning to a main menu. ; ; SIDE EFFECTS:
The pick and place program may be executed, and ; locations may be defined. AUTO choice, quit, $answer quit = FALSE DO TYPE /C2, "PICK AND PLACE OPERATIONAL MENU" TYPE /C1, " 1 => Initiate pick and place" TYPE /C1, " 2 => Teach locations" TYPE /C1, " 3 => Return to previous menu", /C1 PROMPT "Enter selection and press RETURN: ", $answer choice = VAL($answer) ;Convert string to number CASE choice OF ;Process menu request... VALUE 1: ;...selection 1 TYPE /C2, "Initiating Operation..." CALL move.parts() VALUE 2: ;...selection 2 CALL teach() VALUE 3: ;...selection 3 quit = TRUE ANY ;...any other selection eV+Language User's Guide, v2.x, 18318-000 Rev A Page 212