Close a low level file


Use FCLOSE(<filehandle>) to close the file and save your changes. This will return .T. if the file can be closed successfully and .F. if it cannot.

The CLOSE ALL command will close all low level files.

A file handle is essential for these low level functions and it is usual to hold it in a local variable. You must close the file before this variable goes out of scope. Once the file has been opened (or created) it will remain open and locked to other users until it is closed.

The file will remain open even if the variable holding its handle has been overwritten or released. If you wait until you have lost the value of the handle then you will not be able to use FCLOSE to close that specific file.


Other low level topics

Low level overview | FCREATE() | FOPEN() | FREAD() | FWRITE()


Hints & tips

The textbox class in Visual FoxPro 9 has a new Autocomplete property which shows the user the previous values that have been entered in that textbox.
Autocomplete in VFP 9

Your Access database will look more impressive if you add custom toolbars...
Custom toolbars

FoxPro has always had functions to read and write files at a low level...
Foxpro low level file functions

More...
More pages of hints and tips for users of Microsoft FoxPro and Access databases.

Site Map