bas7advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CLOSE Statement Details
  ◄Syntax►  ◄Details►  ◄Example►                 ◄Contents►  ◄Index►  ◄Back►
─────────────────────────────────────────────────────────────────────────────
CLOSE concludes I/O to a file, device, or ISAM table.
 
CLOSE [[#]filenumber%[,[#]filenumber%]...]
    ■ The association of a file, device, or ISAM table with the argument
      filenumber% ends when a CLOSE statement is executed. You then
      can reopen the file, device, or table using the same or a
      different file number.
 
New Features
    ■ CLOSE commits any pending ISAM transactions.
 
Usage Notes
    ■ CLOSE with no arguments closes all open tables and files.
    ■ A CLOSE for a file or device that was opened for sequential
      output writes the final buffer of output to that file or device.
    ■ CLOSE releases all buffer space associated with the closed file,
      device, or table.
    ■ The CLEAR, END, RESET, RUN, and SYSTEM statements, and the CHAIN
      statement when used with the /O command line option, also close
      all files, devices, and tables.
 
Programming Tips
    ■ Any ISAM operation that closes a table causes transactions to be
      committed. For example, if a type mismatch occurs while you are
      opening an ISAM table, the table is closed and a pending transaction
      is committed.
    ■ You may wish to code your programs so they first open all tables,
      then perform all transactions, then close tables. Make sure any
      operation that can close a table occurs outside a transaction.