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 - saveworkarea() saves information about the selected database http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 saveworkarea()      Saves information about the selected database
------------------------------------------------------------------------------
 Declaration
   database.hdr

 Syntax
   proc saveworkarea extern

 Arguments
   None.

 Return
   None.

 Description
   The saveworkarea() procedure temporarily saves information about the
   selected database workarea. The index order, moreover filter and
   relation expressions belonging to a workarea are not saved by this
   function.

   The saved workarea information can later be restored by using the
   restoreworkarea() procedure. This pair of functions allow a subroutine
   to change the selected database without concern for the database of the
   calling code.

 Example
   #define EXAMPLE_DATABASE
   #include example.hdr

   dbfdef sNames3                // no fields will be referenced
   enddef
   
   proc Test_saveworkarea
   open sTest                   // open source database
   copy to "snames3.dbf"        // copy database
   open sNames3                 // open second database
   select sTest                 // select first database
   ? dbf()                      // print "stest.dbf"
   saveworkarea()               // save the workarea
   select sNames3               // select other database
   ? dbf()                      // print "snames3.dbf"
   restoreworkarea()            // restore the saved workarea
   ? dbf()                      // print "stest.dbf"
   close all                    // clean up
   erase "snames3.dbf"
   erase "snames3.dbt"
   endproc

   proc main
   Test_saveworkarea()
   endproc

See Also: restoreworkarea()

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