release statement

The release statement clears locks on items locked with a previous matreadu, readu, or readvu statement.

Syntax

release {file.var,} {ID.exp}

Parameter(s)

file.var Specifies the file containing the item to be unlocked.
ID.exp Specifies the item to be unlocked.

Description

If file.var and ID.exp are both omitted, all items currently locked by the current process are unlocked.

If ID.exp is specified without file.var, the default file variable is used.

Example(s)

In this example, an item is read from the customer file and locked. If a new name is entered, the name attribute is changed, a date stamp is placed in attribute 20 and the item is written, automatically clearing the item lock. If no name is entered, no write occurs, requiring the item lock to be cleared with the release statement.

readu item from customer.file,item-ID then
   input name
   if name # ’’ then
      item<1>=name
      item<20>=date()
      write item on customer.file,item-ID
   end else
      release customer.file,item-ID
   end
end