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 - restoregets() restore a saved get/read http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 restoregets()       Restore a saved get/read
------------------------------------------------------------------------------
 Declaration
   io.hdr

 Syntax
   proc restoregets extern

 Arguments
   None.

 Return
   None.

 Description
   The restoregets() procedure restores information about the get in effect
   during the last savegets().
   
   savegets() allows for the programming of nested gets and may be nested up
   to 20 levels. The savegets() and restoregets() procedures function as a
   stack. That is, the first get saved is the last get restored.
   
   restoregets() and savegets() handle only internal information for the Forc
   runtime library. The displayed screen information can be saved and restored
   only with savescreen() and restorearea().

 Example
   #define EXAMPLE_IO
   #include example.hdr

   // Use savegets/restoregets for a "hot" key.
   
   proc HotKey
   vardef
      char( 1 ) cAnswer
   enddef
   if lastkey() == K_F10
      cAnswer := "N"
      savescreen()
      savegets()                                 // save pending gets
      fill( 8, 25, 13, 55, BOX_DOUBLE, " ", RED_WHITE, RED_WHITE, 6 )
      savecolors()
      __syscolor[ CLR_STD ] := RED_WHITE
      @ 10, 30 say "Abort process? [Y/N]" get cAnswer picture "Y"
      read                                       // execute another get
      if cAnswer == "Y"
         cursor( .f. )
         __syscolor[ CLR_STD ] := RED_YELLOW
         @ 10, 30 ?? "       Aborted        "
         delay( 3 )
         cursor( .t. )
         keyint( K_ESC )
      endif
      restcolors()
      restoregets()                              // restore saved gets
      restorearea()
   endif
   endproc
   
   proc Test_restoregets
   vardef
      char( 2 ) cNum
   enddef
   cNum := "34"
   on key do HotKey                              // install key procedure
   clear
   @ 10, 0 say "Press F10 to abort" get cNum picture "99"
   read
   @ 12, 0 ?? cNum
   endproc

   proc main
   Test_restoregets()
   endproc

See Also: get savegets()

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