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 - use <salias> open database http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 use <sAlias>        Open database
------------------------------------------------------------------------------
 Syntax
   use [cFile alias] sAlias [index indexes] [shared|exclusive|readonly]

 Arguments
   cFile is the name of the database file to open.
   sAlias is an alias declared in a dbfdef block.
   indexes is a list of index aliases.

 Description
   The use sAlias command opens the specified database and index files
   and any associated memo file and assigns sAlias to the database.
   use is not recommended because of its link to the select command; the open
   command is preferred.

   Ten workareas are available to use. 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.

   The cFile parameter defines the file to be used. If cFile is not defined,
   then use will try to open the file set by the most recent set alias.

   The first file specified in the index list will be the master index file.
   The order of the index files is set to 1.

   The keywords shared and exclusive specify the access rights to a database
   file and its associated index and memo files. shared allows the database
   file to be used by several users on a network. exclusive specifies that
   the database file should be used by one person. The status of
   set exclusive serves as the default. The default status for set exclusive
   is on.

   The option readonly opens the database file in read-only mode. It is the
   programmer's responsibility to avoid any write operations while the file
   is opened in this mode - otherwise a run-time error will occur.

 Example
   #define EXAMPLE_DATABASE
   #include example.hdr

   proc Test_usesalias
   use sTest            // open alias with default database name
   ? sTest->lastname, indorder()
   close all            // close alias
   use "stest.dbf" alias sTest index sIdxLN, sIdxB // open with indexes
   ? sTest->lastname, indorder()
   endproc

   proc main
   Test_usesAlias()
   endproc

See Also: open select

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