beautypg.com

Argox PA-20 Basic Programming Manual User Manual

Page 41

background image

PT-Basic Programming Manual Ver. 1.00

40/143

MENU

Purpose: To create a menu.

Syntax: A% = MENU(Item$)

Example: MENU_STR$="1.Auto off"+CHR$(13)

MENU_STR$=MENU_STR$+"2.System Info"+CHR$(13)

MENU_STR$=MENU_STR$+"3.Power on"+CHR$(13)

MENU_STR$=MENU_STR$+"4.Suspend"+CHR$(13)

MENU_STR$=MENU_STR$+"5.Restart"+CHR$(13)

MENU_STR$=MENU_STR$+"6.Exit"+CHR$(13)

MENU_STR$=MENU_STR$+"@SYSTEM

TEST"+CHR$(13)

S%=MENU(MENU_STR$)

ON S% GOTO 10,20,30,40,50,60

Description: A% is an integer variable to be assigned to the result, it is the

ordinal number of the menu item that user has selected.

Item$ is a string variable, indicating the menu item that are

separated and ended by carriage return (CR, 0xd).

This command allows user to select an item by using the

UP/DOWN arrow keys (or the shortcut keys), and then the

ENTER key to confirm the selection. Also it allows the use

of ESC key to cancel the current operation.
 Menu title:@ (the title can be put anywhere in the menu

string)