CloseFile() will affect a variable that has been assigned to a file with either OpenFileRead() or OpenFileWrite(), making it so that that variable is no longer associated with that file. It is used like so:

dim file

file = OpenFileRead("file.txt")
'do stuff

That variable can then be used for anything else, like a normal variable, or can be assigned to another file for reading/writing.

When a Basic4GL program closes, all variables assigned to files are automatically cleared. However, it is best to close them using the program.

This page has been recommended for cleanup, integration, etc.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 2.5 License.