short DoMenu(BSTR pszMenuName)
Function DoMenu(pszMenuName As String) As Integer
Performs the menu choice from a stored menu file.
Return value
The index of the choice made by the user (0 based, the 0 index means the
first line was chosen by the user)
-1 means that the user pressed the CLR key to abort.
-2 means that an RF error occured.
Parameters
pszMenuName
The name of the existing menu file (up to 8 characters).
If a Button Pad configuration exists with the same name, the
menu uses this file (WCE only).
Otherwise, the menu uses the default Button pad file
"_Menu" (WCE only).
Remarks
The name must contain legal characters for MS-DOS filenames. Do not
include dots (.) and other special characters (* , $ \ : etc).
The menu files are created by the StoreMenu
function, and deleted by the DeleteMenu
function.
The menu is shown to the user.
The user moves the cursor with the arrow keys, and selects an option with the ENTER
key.
The user may abort the menu choice with the CLR key.
Example
wsRfMenu.ResetMenu ' Clear the current
building menu
wsRfMenu.AddTitleLine "MyMenu Choices" ' give a title to the menu
For iIdx = 1 To 12
wsRfMenu.AddOption "Option " & Str(iIdx) ' The menu
options
Next iIdx
' store the menu in RF terminal
wsRfMenu.StoreMenu "MyMenu"
iBuff = wsRfMenu.DoMenu("MyMenu")
Select Case iBuff
' RF Error
Case -2
GoTo EndProgram
' CLR (CLEAR) key pressed
Case -1
GoTo EndProgram
Case Else
' Here the choice is the value of iBuff
End Select
See also RFMENU, StoreMenu, DeleteMenu, AddOption, AddTitleLine, ResetMenu, RFBUTTON