DataBasic Reference > Statements and Intrinsic Functions > C > CLOSESEQ 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 ()

CLOSESEQ Statement (DataBasic) (m618703+closeseq_s.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

CLOSESEQ Statement

Closes a host file or Reality item previously open for sequential access, and releases the lock.

Syntax

CLOSESEQ seqfile-var {SETTINGsetting-var} {ON ERROR statement(s)}

Syntax Elements

seqfile-varThe name of a variable containing a sequential file reference (assigned via an OPENSEQ statement).

setting-varThe name of a variable to which the return status is assigned. See Operation for details of the possible values for this variable.

statement(s)A sequence of one or more valid DataBasic statements, either separated by semicolons, or contained on separate lines and followed by an END statement.

Operation

The following details the circumstances under which the ON ERROR clause is executed and the values returned in setting-var:

Clause Executed Reason setting-var STATUS() Value
ON ERROR File or item opened, but not for sequential access (not opened with OPENSEQ) B45 12
  File or item not open B12 12
  General file error Error number Error number

Notes:

Comments

The CLOSESEQ statement is used in conjunction with the OPENSEQ statement. Use this statement when you no longer need to access a host file or Reality item that was opened for sequential access.

Example

OPENSEQ "/usr/pauls/qa4" TO SF1 THEN NULL
.
.
.
CLOSESEQ SF1
.
.
.

This program opens the host file /usr/pauls/qa4 and saves a reference to the open file in variable SF1. When access to the file is no longer needed, it is closed.

See Also

OPENSEQ statement, READSEQ statement, READBLK statement, WRITESEQ statement, WRITEBLK statement, SEEK statement, DELETESEQ statement, WEOFSEQ statement.

RealityV15.0Comment on this topic