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, which consists of the text on error followed by a statement list, 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

See Also

Default File Variables

delete() Function

File Variable

ID Expression

inputerr Statement

Statements and Functions