The OpenFile( ) and CloseFile( ) subroutines perform the overhead required when opening and closing a file, and are defined in the include file (FILEIO.INC).
One of the important points to note with these subroutines is their use of a file identifier. The file identifier is actually an integer, or handle, which is used internally to identify the file. This provides a more efficient means of accessing the file. A call to OpenFile( ) associates the file identifier with the file to be opened. Therefore, whenever I/O is to be performed on the file, the file identifier is used instead of the filename, and it is always the first argument in all of the File I/O Library subroutines. A call to CloseFile( ) disassociates the file identifier from the file.