Cicode Programming Reference > Cicode Function Categories > Device Functions Introduction > DevZap

DevZap

Zaps a device. If a database device is zapped, all records are deleted. If an ASCII file is zapped, the file is truncated to 0 (zero) length. Use this function when you want to delete all records in a database or file without deleting the actual file.

Syntax

DevZap(hDev)

hDev:

The device handle, returned from the DevOpen() function. The device handle identifies the table where all data on the associated device is stored.

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

DevDelete

Example

! Delete all records in the alarm log database.
hDev = DevOpen("AlarmLog", 0);
DevZap(hDev);

See Also

Device Functions