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 - zap remove all records and associated memo fields http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 zap                 Remove all records and associated memo fields
------------------------------------------------------------------------------
 Syntax
   [!sAlias] zap

 Arguments
   sAlias is the database to operate on.

 Description
   The zap command removes all records and their associated memo fields from
   the current or selected alias, then reindexes if necessary. zap closes and
   recreates any index or memo files associated with the alias.

 Example
   #define EXAMPLE_DATABASE
   #include example.hdr

   proc Test_zap
   vardef
      char cAnswer
   enddef
   open "stest.dbf" alias sTest index sIdxLN, sIdxB
   ? "Number of records", istr( reccount() )
   wait "Do a delete all / pack instead of zap? (Y/N) " to cAnswer
   if cAnswer $ "Yy"
      !sTest delete all // delete all, pack is the same as zap
      !sTest pack
   else
      !sTest zap // zap deletes all records, regardless of the deleted flag
   endif
   ? "Number of records", istr( reccount() )
   endproc

   proc main
   Test_zap()
   endproc

See Also: pack zaprec()

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