The Menu can be activated in two ways:
Both cases can be handled by the same PROC
Here's how to handle it:
- The [Menu] key
- The stylus pointing at the upper left corner.
GLOBAL lastused% REM Defined in the first PROC, NOT in this...
LOCAL selected% REM Defined in THIS PROC
this part of the code creates three menus and displays them, placing the result in the
selected% variable. Some points to remember in this code:
As for what to do with the value in the Selected% variable:
- The MENU command can take a parameter. It must be a variable, and not a constant.
It is used to select which part of the menu that will be 'selected' when the menu is displayed. Afterwards it will
contain the position in the menu the user chose. This allows the App to 'remember' where the user left off.
- Some choices will have apparent 'negative' values(-%x). This causes the system to place a line below this choice.
(Don't overdo it!)
- Some choices have a numeric(between 1 and 32) after it. Those numbers will not show up, but will be returned by the MENU command.
If you used any numerics between 1 and 32 those must be handled separately. Then do the Lower case/Upper case values:
Messy? You could do this:
IF selected% REM just in case the user Escape's...
IF selected% < 28 REM Numeric
ELSEIF selected% < 96 REM Upper case
ELSE REM Lower case
The @() function calls a procedure with the same name as the input string. it CAN NOT call procedures that need Input parameters OR returns a value...