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 - go top move the record pointer to the first logical record http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 go top              Move the record pointer to the first logical record
------------------------------------------------------------------------------
 Syntax
   [!sAlias] go[to] top

 Arguments
   sAlias is the database to operate on.

 Description
   The go top command sets the record pointer to the first logical record.

   go top respects the order of a controlling index file, filters or the
   deleted flag. To go to the last physical record in the alias, use
   go reccount() or  go areccount( sAlias ).

 Example
   #define EXAMPLE_DATABASE
   #include example.hdr

   proc Test_gotop
   /*
   If a database is indexed, the top or bottom
   record is considered the first or last logical record.
   */
   open "stest.dbf" alias sTest index sIdxLN
   !sTest goto top //  Positions record pointer at the record indicated
                   //  by the index file. This is not necessarily record 1.
   ? recno()
   close all
   open sTest
   /*
   If the first record is deleted, goto top will position the record pointer
   at record 1 if the set delete flag is off.
   */
   delete                      // delete record 1
   go top                      // we are at record 1
   ? recno()
   set delete on               // we are at record 2
   goto top
   ? recno()
   endproc

   proc main
   Test_gotop()
   endproc

See Also: go go bottom skip

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