Command ZAP Foundation

Deletes all records in the current work area or in the work area specified with the IN clause

Syntax
ZAP [IN <nWorkArea> | <cAlias> ]
Parameters
IN <nWorkArea>
<nWorkArea> is a positive integer specifying the ordinal number of the work area being selected.
IN <cAlias>
This argument is either a literal alias name or a character expression containing the alias name in parentheses. The alias name indicates the work area whose files are to be closed.
Description

The command ZAP physically deletes all records in the current work area or in the work area as specified with the IN clause. If memo fields are present, the contents of the memo file are also deleted.

The command ZAP should only be used with caution because after its execution, all records are permanently deleted. They can no longer be recovered using RECALL.

In a multi-user application in network operation, the file must be exclusively open in the current work area to be able to execute the command ZAP. A file lock with FLock() is not sufficient.

Examples
ZAP
// The example shows the use of ZAP in a network 
// operation of a multi-user application. The data 
// records of a temporary file are deleted. 

PROCEDURE Main 

   DO WHILE .T. 
      USE Sold EXCLUSIVE NEW 

      IF Neterr() .AND. ; 
         Alert( "File cannot be opened!" , ; 
                 {"Retry", "Cancel"} ) <> 2 
         LOOP 
      ENDIF 

      EXIT 
   ENDDO 

   IF Used() 
      ZAP 
      CLOSE Sold 
   ENDIF 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.