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 - recall restore records marked for deletion http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 recall              Restore records marked for deletion
------------------------------------------------------------------------------
 Syntax
   [!sAlias] recall [scope] [while lExp] [for lExp]

 Arguments
   sAlias is the database to operate on.
   scope specifies a portion of the source database.
   lExp is a logical expression.

 Description
   The recall command restores records marked for deletion in the current or
   selected alias.

   The default scope for recall is the current recurd. If the set delete flag
   is on, then the scope identifiers all, rest, and next can not be used,
   instead the scope identifier record must be used.

   Records removed from the alias by the pack or zap commands cannot be
   restored by recall.

 Example
   #define EXAMPLE_DATABASE
   #include example.hdr

   func ulong DeletedCount
   param alias sDbf
   // Return the number of deleted records in a database
   vardef
      ulong   nRecs
      logical lDelFlag
   enddef
   lDelFlag := getsetdeleted( .t. )
   !sDbf count to nRecs                   // count visible records
   setdeleted( lDelFlag )
   return( areccount( sDbf ) - nRecs )    // return number of deleted records
   endfunc
   
   proc Test_recall
   open sTest                             // open database
   ? DeletedCount( sTest )                // show number of deleted records
   !sTest delete all for sTest->sex       // delete several records
   ? DeletedCount( sTest )                // show number of deleted records
   recall all                             // undelete all deleted records
   ? DeletedCount( sTest )                // show number of deleted records
   delete record 5                        // delete record 5
   ? DeletedCount( sTest )                // show number of deleted records
   go 5                                   // position to record 5
   recall                                 // recall record 5
   ? DeletedCount( sTest )                // show number of deleted records
   endproc

   proc main
   Test_recall()
   endproc

See Also: Database command scope table delete

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