delete statement

The delete statement removes a specific item from a file.

Syntax

delete {file.var}, ID.exp{on.error.clause}

Parameter(s)

file.var File from which the specified item will be deleted.
ID.exp Item to delete.
on.error.clause Consists of text on error followed by a statement list.

Description

The on.error.clause is taken if the update fails due to a lost network connection or a callx that executes an inputerr statement.

Example(s)

This program deletes a specific item from the customer.file. yes is the only valid answer to perform the delete.

open ’customer’ to customer.file else stop 201,’customer’
input customer-ID
crt ’are you sure? ’:
input ans
if ans = ’yes’ then delete customer.file,customer-ID