Template
Function
Name
__AtPrompt()
Category
API
Subcategory
User interface
Oneliner
Display a menu item on screen and define a message
Syntax
__AtPrompt( <nRow>, <nCol>, <cPrompt>, [<xMsg>] ) --> .F.
Arguments
<nRow> is the row number to display the menu <cPrompt>. Value could range from zero to MaxRow().
<nCol> is the column number to display the menu <cPrompt>. Value could range from zero to MaxCol().
<cPrompt> is the menu item character string to display.
<xMsg> define a message to display each time this menu item is highlighted. <xMsg> could be a character string or code block that is evaluated to a character string. If <xMsg> is not specified or of the wrong type, an empty string (“”) would be used.
Returns
__AtPrompt() always return .F.
Description
With __AtPrompt() you define and display a menu item, each call to __AtPrompt() add another item to the menu, to start the menu itself you should call the __MenuTo() function (MENU TO command). You can define any row and column combination and they will be displayed at the order of definition. After each call to __AtPrompt(), the cursor is placed one column to the right of the last text displayed, and Row() and Col() are updated.
@…PROMPT command is preprocessed into __AtPrompt() function during compile time.
Examples
// display a two line menu with status line at the bottom // let the user select favorite day SET MESSAGE TO 24 CENTER @ 10, 2 PROMPT "Sunday" MESSAGE "This is the 1st item" @ 11, 2 PROMPT "Monday" MESSAGE "Now we're on the 2nd item" MENU TO nChoice DO CASE CASE nChoice == 0 // user press Esc key QUIT CASE nChoice == 1 // user select 1st menu item ? "Guess you don't like Mondays" CASE nChoice == 2 // user select 2nd menu item ? "Just another day for some" ENDCASE
Compliance
C (menu)
Files
Library is core
Seealso
AChoice(), MENU TO, SET MESSAGE, SET INTENSITY, SET WRAP, __MenuTo()
Pingback: Harbour Internal Functions | Viva Clipper !
Pingback: Harbour Menu Functions | Viva Clipper !
Pingback: Harbour RG Summary | Viva Clipper !