# DELETE

Updated: 11/30/2021, 7:00:45 PM
Created: 11/30/2021, 7:00:45 PM
Last Updated By: Jake Tuttle
Read Time: 1 minute(s)

Tags: records file operations

# Description

This statement is used to delete a record from a jBASE file. It takes the general form:

DELETE {variable,} expression {SETTING setvar} {ON ERROR statements}
1

Where:

  • If specified, variable should have been the subject of a previous OPEN statement. If variable is omitted then it assumes the default file variable.
  • expression should evaluate to the name of a record stored in the open file.
  • If the SETTING clause is specified and the delete fails, it sets setvar to one of these file error values.

# Note

The statement will have no effect if the record name does not exist within the file. If a lock was being held by the program against the file record, then the lock will be released.

An example of use is as:

OPEN "test_rec" TO file_variable ELSE ABORT 201, "test_rec"
DELETE file_variable , "001"
1
2

to delete the record "001" from the file test_rec .

Go back to jBASE BASIC

Go back to Programmers' Reference Guide