Delete data

Command group Flag affected Reversible Execute on client Platform(s)
Data management YES NO NO All

Syntax

Delete data {file-name}

Description

This command deletes all the data and indexes for a specified file in a data file. The data and indexes for a file class are called a "slot". You can delete a slot only if and when one user is logged onto the data file.

If a specified file name does not include a data file name as part of the notation, the default data file for that file is assumed. If the file is closed or memory-only, the command does not execute and returns flag false. If you are not running in single user mode, the command automatically tests that only one user is using the data file (the command fails with the flag false if this is not true), and further users are prevented from logging onto the data until the command completes.

If a working message with a count is open while the command is executing, the count will be incremented at regular intervals. The command may take a long time to execute, and it is not possible to cancel execution even if a working message with cancel box is open. The command sets the flag if it completes successfully and clears the flag otherwise. It is not reversible.

Example

Delete data {fCustomers}
If flag true
  OK message {Data for fCustomers has been deleted}
Else
  OK message Error {Data could not be deleted}
End If