Wiki Home

Zap Command


Namespace: VFP
The ZAP command unconditionally removes all records from a table, but leaves the table structure intact. All indexes are recreated in their zero-record state. Depending on the setting of SET SAFETY (ON/OFF), the user is prompted as to whether they want to perform this command. Requires EXCLUSIVE use of the table.

ZAP doesn't fire the delete trigger and therefore can harm referential integrity if used for a database table.

I'm sure everyone knows all of this, but I wanted to be the first to enter a topic starting with a Z :).

Also known as "The most powerful 3 letters in xBase."

The ZAP command may be powerful, but its power can be very beneficial. Just see my tip in the May 2001 Foxpro Advisor http://www.advisor.com/Articles.nsf/aid/SILVL14-01. Basically, use ZAP to empty out views instead of requerying a known impossible value. The tip doesn't mention that the more complex the query/view, the greater the performance improvement. This is a real, visible performance improvement in many of my views. -- Mike Yearwood

Favorite user hostile command: ON KEY LABEL F1 ZAP
Don't try this at home, kids! The ZAP command is totally irreversible.
Stands for 'Zero All Pointers' ... or so the legend goes. --AlanBourke
My understanding is that it stands for "Zero And Pack." -- Tamar Granor

Contributors: Randy Pearson, Christof Wollenhaupt, Mike Yearwood
Category VFP Commands
( Topic last updated: 2001.06.13 01:29:08 PM )