User`s guide

GOTO 100
END
DO ;Main processing loop
; Display the top-level menu
CALL mcp.disp.main()
; Get the operator selection (must be between 1 and 5)
DO
button = PENDANT(0)
UNTIL (button < 6)
; Turn on the LED of the selected button
WRITE (mcp) $CHR(mcp.on.led), $CHR(button), /S
; Respond to the menu item selected
CASE button OF
VALUE 1: ;Verify program exit
CALL mcp.main.quit(quit)
VALUE 2:
CALL mcp.option.2()
VALUE 3:
CALL mcp.option.3()
VALUE 4:
CALL mcp.option.4()
VALUE 5:
CALL mcp.option.5()
END ;CASE button of
; Turn off LED
WRITE (mcp) $CHR(mcp.off.led), $CHR(button), /S
UNTIL quit
; Detach from the MCP
DETACH (mcp)
100 IF NOT quit THEN ;Exit on MCP busy
TYPE /C34, /U17, "The MCP is busy or not connected."
TYPE "Press the REC/DONE button to clear.", /C5
END
Programming Example: Pendant Menu
V+Language User's Guide, v17.0
Page 302