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 - savegets() save the state of a get/read http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 savegets()          Save the state of a get/read
------------------------------------------------------------------------------
 Declaration
   io.hdr

 Syntax
   proc savegets extern

 Arguments
   None.

 Return
   None.

 Description
   The savegets() procedure stores information about the read in progress so
   that another set of get fields may be read. This procedure is typically
   used within a filter or valid function of a get.

 Example
   #define EXAMPLE_IO
   #include example.hdr

   // The get filter clause allows you to program context sensitive help
   
   proc HelpFunc
   param value byte uTopic
   cursor( .f. )
   @ 5, 52 ?? "Help topic", uTopic
   getkey()
   cursor( .t. )
   endproc
   
   func uint HelpFilter
   vardef
      _HSCR hScreen
      uint  uKey
      byte  uTopic
   enddef
   uKey := lastkey()
   if uKey == K_F1
      hScreen := savescrn( 1, 50, 8, 75 )
      fill( 1, 50, 8, 75, "********", " ", BLUE_WHITE, BLUE_YELLOW, 6 )
      savegets()                      // save gets
      uTopic := 1
      savecolors()
      __syscolor[ CLR_STD ] := BLUE_WHITE
      @ 3, 52 say "What help topic?   " get uTopic picture "9"
      read
      HelpFunc( uTopic )
      restcolors()
      restoregets()
      restorescrn( hScreen )          // restore gets
      uKey := 0                       // read ignores 0
   endif
   return( uKey )
   endproc
   
   proc Test_savegets
   vardef
      char( 20 ) cName
   enddef
   cName := "Julie"
   clear
   @ 1, 0 say "Name" get cName filter HelpFilter()
   read
   endproc

   proc main
   Test_savegets()
   endproc

See Also: get restoregets()

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