64
CipherLab BASIC Programming Part I
MENU
Purpose To create a menu.
Syntax A% = MENU(Item$)
Remarks “A%” is an integer variable to be assigned to the result.
It is the ordinal number of the menu item that user has selec
ESC key is pressed to cancel the operation, it will return 0.
“Item$”
is a string variable, indicating the menu items that are separated and
ended by carriage return (CR, 0x0d).
This command lets user select an item by using (1) the UP/DOWN a
and then the ENTER key to confirm the selection, or (2) the shortcut keys.
Note that the following features –
Shortcut key: & (It is restricted to only one character next to &.)
Menu title: @ (The title can be put anywhere in the menu string.)
Display the Up/Down arrow icons
A menu can have up to 32 items.
Each item can be a string with maximum
length allowed as shown below. If the
total characters of the string exceed
the maximum characters allowed in one line per screen,
displayed in a next line.
8000
Maximum length allowed for an item is 16 bytes.
8300 Maximum length allowed for an item is 20 bytes.
8200, 8400,
8500, 8700
Maximum length allowed for an item is 26 bytes.
Example Below is an illustrative example:
MENU_STR$ = “1 INFORMATION” + CHR$(13)
MENU_STR$ = MENU_STR$ + “@SYSTEM MENU” + CHR$(13)
MENU_STR$ = MENU_STR$ + “&2 SETTINGS” + CHR$(13)
MENU_STR$ = MENU_STR$ + “&3 TESTS” + CHR$(13)
MENU_STR$ = MENU_STR$ + “4 LOAD PROGRAM” + CHR$(13)
MENU_STR$ = MENU_STR$ + “&5 BLUETOOTH MENU” + CHR$(13)
…
S% = MENU(MENU_STR$)
…