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 - set delete control the deleted flag http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 set delete          Control the deleted flag
------------------------------------------------------------------------------
 Syntax
   [!sAlias] set delete on|off

 Arguments
   sAlias is the database to operate on.

 Description
   The set delete command controls the deleted flag. The default status of
   the delete flag is off.

   If the deleted flag is on, then records that have an attribute of
   deleted will be ignored by the skip, go top, go bottom commands.

   This is logically identical to the command:

   set filter to .not. deleted()

   If the deleted flag is off, then all records with an attribute of deleted
   will be seen by the skip, go top and go bottom commands.

 Example
   #define EXAMPLE_DATABASE
   #include example.hdr

   func uint DeletedPercent
   param alias sDbf
   // Return the percent of the database that has been deleted
   // Sensitive to the set delete flag (use getsetdeleted() to make
   // it insensitive)
   vardef
      ulong nTotal
      ulong nRec
   enddef
   nRec := arecno( sDbf )        // save current record
   !sDbf count to nTotal
   go nRec                       // restore current record
   return( 100 * ( areccount( sDbf ) - nTotal ) / areccount( sDbf ) )
   endfunc
   
   proc Test_setdelete
   open sTest
   delete all for sTest->firstname = "Amy" // delete some records
   ? DeletedPercent( sTest ), "% is deleted"
   set delete on                 // flag must be on for the function to work
   ? DeletedPercent( sTest ), "% is deleted"
   endproc

   proc main
   Test_setdelete()
   endproc

See Also: getdeleted()

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