[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|             PROMPT              |
+---------------------------------+
PROMPT()

-----------------------------------
Returns prompt of pad chosen from menu bar or option chosen from popup.
Return value - Character
-----------------------------------

The PROMPT() function returns, as a character string, the option chosen
on an active menu popup.  The value returned by PROMPT() depends on the
options used when specifying the menu popup.

If the FIELD clause was used with the DEFINE POPUP command, PROMPT()
returns the selected field's contents.  If the FILES clause was used,
PROMPT() returns the selected file name, complete with path and
extension.  If the STRUCTURE clause was used, PROMPT() returns the name
of the selected field, in uppercase.

If a menu popup is not active or the Esc key is pressed to exit a menu
popup, the null string is returned.

+---------------------------------+
|         Program Example         |
+---------------------------------+
In this example menu bar with two menu pads is defined and popup is
assigned to each menu pad.  When item is chosen from popup, two values
are passed to TMENU routine by POPUP() and PROMPT().  POPUP() passes
name of active popup, and PROMPT() passes prompt that was chosen.  TMENU
routine then displays names of popup and prompt that were chosen.

CLEAR
DEFINE MENU mainmenu
DEFINE PAD invoices  OF mainmenu PROMPT ' \<INVOICES '  AT 2,00
DEFINE PAD customers OF mainmenu PROMPT ' \<CUSTOMERS ' AT 2,20

ON SELECTION PAD invoices  OF mainmenu ACTIVATE POPUP invpop
ON SELECTION PAD customers OF mainmenu ACTIVATE POPUP custpop

DEFINE POPUP invpop FROM 4,1
DEFINE BAR  1 OF invpop PROMPT '\<The invoice stack'
DEFINE BAR  2 OF invpop PROMPT '\<Print one or a bunch of invoices'
DEFINE BAR  3 OF invpop PROMPT '\<Show me what my sales are'
ON SELECTION POPUP invpop DO tmenu WITH POPUP(), PROMPT()

DEFINE POPUP custpop FROM 4,14
DEFINE BAR  1 OF custpop PROMPT '\<Look at the Customer info'
DEFINE BAR  2 OF custpop PROMPT 'L\<ist my customers'
DEFINE BAR  3 OF custpop PROMPT '\<Make customer labels'
DEFINE BAR  4 OF custpop PROMPT '\<The Customer Ledger'
ON SELECTION POPUP custpop DO tmenu WITH POPUP(), PROMPT()

ACTIVATE MENU mainmenu

PROCEDURE tmenu
PARAMETER mpopup, mprompt
DO CASE
 CASE mpopup = 'INVPOP'
  WAIT WINDOW 'Selected prompt of invpop is: ' + mprompt NOWAIT
 CASE mpopup = 'CUSTPOP'
  WAIT WINDOW 'Selected prompt of custpop is: ' + mprompt NOWAIT
ENDCASE
RETURN

-----------------------------------

See Also:  BAR(), DEFINE POPUP, DEFINE MENU, POPUP(), PRMBAR()

-----------------------------------

See Also: BAR() DEFINE POPUP DEFINE MENU POPUP() PRMBAR()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson