RELEASE Statement

The RELEASE statement releases item locks in a file, without performing an update.

Format

RELEASE [[filevar,] item-ID]

Parameter(s)

filevar

File variable to which the file had been opened. If filevar is omitted and item-ID is specified, the default file variable is used, which is the last file opened without a file variable assigned.

item-ID

An expression evaluating to the item-ID to be released. If item-ID is not specified, then filevar cannot be specified, and all item locks set by the current program are released.

Description

The RELEASE statement unlocks any item locks set by the READU, READVU, and MATREADU statements.

Item locks may be released through a WRITE, WRITEV, MATWRITE, DELETE, or RELEASE statement, or by ending the program execution.

Example

In this application, item locks are set with the READU statement at the onset of the program, but once it is verified that the item will not be updated during the execution of the program, the RELEASE statement is used to free the item for other users.

READU INFO.REC FROM INFOFILE,ID ELSE

   PRINT ID : " NOT FOUND."

   STOP

END

PRINT "CURRENT INFORMATION ON THAT CUSTOMER IS: "

NO.OF.ATTRS = DCOUNT(INFO.REC , CHAR(254))

FOR I = 1 TO NO.OF.ATTRS

   PRINT I

END

PRINT "IS THIS CORRECT (Y OR N)"

INPUT ANSWER,1

IF ANSWER = "Y" THEN

   RELEASE INFOFILE,ID

END

   .

   .

   .

See Also

Statement and Function Reference