The delete statement removes a specific item from a file.
delete {file.var}, ID.exp{on.error.clause}
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. |
The on.error.clause is taken if the update fails due to a lost network connection or a callx that executes an inputerr statement.
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