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 - ! alias override operator (unary) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 !                   Alias override operator (unary)
------------------------------------------------------------------------------
 Syntax
   ! <alias> <command>

 Arguments
   <alias> is a database alias declared in a dbfdef block.
   <command> is a database command.

 Description
   The ! operator is used to specify a database alias for a
   command to operate on. When the ! operator and the accompanied
   alias name is omitted, database commands work on the current alias.
   The ! operator is used to override the default alias similarly how
   database functions accept an alias as a parameter.

 Example
   #define EXAMPLE_OPERATOR
   #include example.hdr

   dbfdef sTest1
      char( 10 ) fchar
   enddef
   
   dbfdef sTest2
      char( 10 ) fchar
   enddef
   
   proc Test_910
   vardef
      uint n
   enddef
   build "stest1.dbf" from alias sTest1 // create databases
   build "stest2.dbf" from alias sTest2
   open sTest1                          // open databases
   open sTest2                          // this alias becomes the current
   for n := 1 to 10
      ! sTest1 append blank             // add records to 1st database
      ! sTest2 append blank             // add records to 2nd database
   next
   go top                               // affects current (2nd) database
   ? arecno( sTest1 ), arecno( sTest2 )
   ! sTest1 go top                      // override acting on current database
   ? arecno( sTest1 ), arecno( sTest2 )
   close all
   erase "stest1.dbf"                   // clean up
   erase "stest2.dbf"
   endproc

   proc main
   Test_910()
   endproc

See Also: ->

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