CloseSeq Statement

Closes a file after sequential processing.

Syntax

CloseSeq file.variable [On Error statements ]

file.variable specifies a file previously opened with an OpenSeq statement.

On Error statements specifies statements to execute if a fatal error occurs during processing of the CloseSeq statement.

Remarks

Each sequential file reference in a routine must be preceded by a separate OpenSeq statement for that file. OpenSeq sets an update record lock on the file. This prevents any other program from changing the file while you are processing it. CloseSeq resets this lock after processing the file. Multiple OpenSeq operations on the same file only generate one update record lock so you need only include one CloseSeq statement per file.

If a fatal error occurs, and no On Error clause was specified:

  • An error message appears.
  • Any uncommitted transactions begun within the current execution environment roll back.
  • The current program terminates.

If the On Error clause is taken, the value returned by the Status function is the error number.