Futurebasic/Language/Reference/on menu

Description
This statement designates a particular function or subroutine as a menu-event handling routine. A menu-event handling routine is called in response to the user selecting an item from a menu. This includes menu items that your program puts into menus on the menu bar, but it doesn't include items in pop-up menus; see the  function for more information.

When the user clicks on the menu bar, FB does not open up the menu immediately. Instead, your program continues executing until a  statement is reached. If the mouse button is still down at that time,  then opens the menu, tracks the user's selection, then calls your menu-event handling routine if the user selected a menu item. Your routine should examine the  and  functions to get information about the event.

Note: If you use the  syntax, then   must refer to a function which was defined or prototyped at an earlier location in the source code. Your menu-event handling function should not take any parameters, nor return a result.