RDD

DbDelete()

Mark the current record for deletion

Syntax

Signature
DbDelete() --> NIL

Arguments

None.

Return value

NIL.

Description

DbDelete() marks the current record in the current work area as deleted. The record remains in the file until it is physically removed by DbPack().

Notes

The deleted flag can be inspected with Deleted(). Use DbRecall() to clear it.

Example

DbDelete.prg
PROCEDURE Main()

   DbCreate( "delete_demo.dbf", { { "NAME", "C", 12, 0 } } )
   DbUseArea( .T., , "delete_demo.dbf", "People" )
   DbAppend()
   FieldPut( 1, "Anna" )
   DbCommit()
   DbGoTop()
   DbDelete()
   QOut( "Deleted: " + IIF( Deleted(), "YES", "NO" ) )
   DbRecall()
   QOut( "After recall: " + IIF( Deleted(), "YES", "NO" ) )
   DbCloseArea()
   FErase( "delete_demo.dbf" )


   RETURN

Output

See also