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 - savemenu() save current menu/prompt data http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 savemenu()          Save current menu/prompt data
------------------------------------------------------------------------------
 Declaration
   menu.hdr

 Syntax
   func _MENU savemenu extern

 Arguments
   None.

 Return
   A pointer to the saved menu object.

 Description
   This function saves the current menu, allowing another menu to be
   created without having to recreate the current menu. Use the
   restoremenu() procedure to restore a saved menu.

 Example
   #define EXAMPLE_MENU
   #include example.hdr

   // Save a menu prior to initiating another menu...
   
   vardef
      _MENU pMenu
      uint  uSel
   enddef
   
   proc ExitConfirm
   pMenu := savemenu()
   @ 3, 20 prompt "Resume"
   @ 4, 20 prompt "Quit"
   menu to uSel
   if uSel == 1
      restoremenu( pMenu )
      @ 3, 20 clear to 4, 40
   else
      quit
   endif
   endproc
   
   proc Test_savemenu
   vardef
      uint uChoice
   enddef
   clear
   cursor( .f. )
   @ 1,  0 prompt "Add"
   @ 1, 10 prompt "Edit"
   @ 1, 20 prompt "Quit"
   uChoice := 0
   do while .t.
      wait
      menu to uChoice save
      wait
      do case
      case uChoice == 1
         @ 10, 0 ?? uChoice
      case uChoice == 2
         @ 10, 0 ?? uChoice
      case uChoice == 3
         ExitConfirm()
      endcase
   enddo
   endproc

   proc main
   Test_savemenu()
   endproc

See Also: menu to prompt restoremenu()

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