Command ZAP Foundation
Deletes all records in the current work area or in the work area specified with the IN clause
ZAP [IN <nWorkArea> | <cAlias> ]
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.
// 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
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.