DataBasic Reference > Statements and Intrinsic Functions > C > CLOSE Statement

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

Reality V15.0 ()

CLOSE Statement (DataBasic) (m618703+close_s.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

CLOSE Statement

Closes one or more OPENed files.

Syntax

CLOSE filevar{, filevar} ...

Syntax Elements

filevar is the name of a variable containing a file reference (assigned via an OPEN statement).

Operation

The CLOSE statement is used in conjunction with the OPEN statement. Use this statement when you no longer need to access an opened local or remote file.

If the specified file has not been opened prior to the CLOSE statement, the program aborts with a "File has not been opened" error message.

You can test whether the variable refers to an open file with the VARVALTYPE function.

Any item locks held on the file are released.

Example

OPEN 'QA4'TO F1 ELSE PRINT "NO FILE"; STOP
.
.
CLOSE F1
.
.

This program opens the file QA4 and saves a reference to the open file in variable F1. If QA4 does not exist, the message NO FILE is displayed and the program terminates. When access of QA4 is no longer necessary, it is closed.

RealityV15.0Comment on this topic