Close File statement - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Closes an open file.

Syntax

Close File [ # ] filenum 

filenum is an integer number identifying which file to close.

Description

The Close File statement closes a file which was opened through the Open File statement.

Note: The Open File statement and Close File statement operate on files in general, not on MapInfo Pro tables. MapBasic provides a separate set of statements (e.g., Open Table statement) for manipulating MapInfo tables.

Example

Open File "cxdata.txt" For INPUT As #1 
'
' read from the file... then, when done: 
'
Close File #1

See Also:

Open File statement