Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - prompt add an item to the current menu structure http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 prompt              Add an item to the current menu structure
------------------------------------------------------------------------------
 Syntax
   @ uRow, uCol prompt cPrompt [message cMessage] [id uId]

 Arguments
   uRow is the row for the prompt.
   uCol is the start column for the prompt.
   cPrompt is the prompt text.
   cMessage is a message string displayed when a prompt item is selected.
   uId is a numeric identifier associated with the prompt.

 Description
   The prompt command prints the character string to the device selected
   by the set device to command. The string is positioned at the specified
   coordinates and referred to a menu selection pad.

   prompt also builds an internal menu structure for use by the menu to
   command. prompt allocates memory and optionally assigns an id number and
   a message to the selection. Messages are displayed at the position
   specified by set message to when selections are highlighted.

   If an id clause is not given for a prompt, the id is assigned based on
   the number of prompt commands which have been executed. The default id
   for the first prompt is 1.

   The cPrompt argument may contain a hot key definition. See the description
   of the menu to command for information on hot key usage.

 Example
   #define EXAMPLE_MENU
   #include example.hdr

   #define AR_ACCT 10
   #define AR_TRAN 11
   #define AR_INVC 12
   #define AR_PROD 13
   #define AR_EXIT 14
   
   proc Test_prompt
   vardef
      uint uChoice
      uint uKey
      uint uPosition
   enddef
   clear
   set message to 24
   
   @  3, 10 prompt "Account maintenance" message ;
            "Maintenance of accounts & customer info." ;
            id AR_ACCT
   
   @  5, 10 prompt "Transaction maintenance" message ;
            "Maintenance of payments, and charges." ;
            id AR_TRAN
   
   @  7, 10 prompt "Invoice maintenance" message ;
            "Order and Invoice maintenance screen." ;
            id AR_INVC
   
   @  9, 10 prompt "Product maintenance" message ;
            "Product list maintenance for invoicing." ;
            id AR_PROD
   
   @ 11, 10 prompt "Exit Accts Receivable" message ;
            "Exit to main accounting menu." ;
            id AR_EXIT
   
   uChoice := AR_ACCT
   
   repeat
      menu to uChoice save  // save menu for repeated use
      uKey := lastkey()
      if uKey < 128
         uPosition := at( upper( chr( uKey ) ), "ATIPE" )
         if uPosition > 0
            uChoice := uPosition + AR_ACCT - 1
            uKey := K_ENTER
         endif
      endif
      if uKey == K_ENTER
         do case
         case uChoice == AR_ACCT
            @ 15, 0 ?? 'run "ARACCT.EXE"'; wait
         case uChoice == AR_TRAN
            @ 15, 0 ?? 'run "ARTRAN.EXE"'; wait
         case uChoice == AR_INVC
            @ 15, 0 ?? 'run "ARINVC.EXE"'; wait
         case uChoice == AR_PROD
            @ 15, 0 ?? 'run "ARPROD.EXE"'; wait
         case uChoice == AR_EXIT
            exit
         endcase
         @ 15, 0 clear to 16, 50
      endif
   until uKey == K_ESC
   endproc

   proc main
   Test_prompt()
   endproc

See Also: menu to

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson