Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?

FILEUNLOCK

Description

This statement is used to release a file lock set by the FILELOCK statement. It takes the general form:

FILEUNLOCK [file.variable] [ON ERROR statements]

where

  • file.variable specifies a file previously locked with a FILELOCK statement. If file.variable is not specified, the default file with the FILELOCK statement is assumed. If file.variable is not a valid file variable then the FILEUNLOCK statement will enter the debugger.
  • The ON ERROR clause is optional in the FILEUNLOCK statement. The ON ERROR clause allows the programmer to specify an alternative for program termination when encountering a fatal error during processing of the FILEUNLOCK statement. If a fatal error occurs, with no ON ERROR clause specified, the program enters the debugger.

If the ON ERROR clause is used, the value returned by the STATUS  function is the error number.

In the following example, the first FILEUNLOCK statement unlocks the default file. The second FILEUNLOCK statement unlocks the file variable FILE.

OPEN '','file_one' ELSE STOP "Can't open file_one"
FILELOCK
FILEUNLOCK

OPEN 'file_two' TO FILEVAR ELSE STOP
FILELOCK FILEVAR
FILEUNLOCK FILEVAR

 

Go back to jBASE BASIC.

Was this article helpful?