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 - select activate a work area http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 select              Activate a work area
------------------------------------------------------------------------------
 Syntax
   select sAlias|uWorkArea

 Arguments
   sAlias is the database whose associated workarea is to be selected.
   uWorkArea specifies the workarea by its order number.

 Description
   The select command activates the specified work area.

   Ten workareas are available to select. The use command by default
   opens all databases in the current workarea. To open databases in
   specific workareas, use the select command with a numeric parameter
   prior to issuing the use command, then use select with the workarea number
   or the alias name to move along varius workareas. The open command offers
   a more convenient way of doing the same.

   Number 1 is the default work area. There is no default sAlias. Only an
   sAlias specified by use can be selected.

 Example
   #define EXAMPLE_DATABASE
   #include example.hdr

   dbfdef sNames1                // no fields will be referenced
   enddef
   
   proc Test_select
   select 1                        // select the workarea to be used
   use "stest.dbf" alias sTest     // open source database
   ? dbf()                         // print "stest.dbf"
   copy to "snames1.dbf"           // copy database
   select 2                        // select the workarea to be used
   use "snames1.dbf" alias sNames1 // open second database
   ? dbf()                         // print "snames1.dbf"
   select 1                        // select first database
   ? dbf()                         // print "stest.dbf"
   select 2                        // select other database
   ? dbf()                         // print "snames1.dbf"
   close all                       // clean up
   erase "snames1.dbf"
   erase "snames1.dbt"
   endproc

   proc main
   Test_select()
   endproc

See Also: open use

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