File Handles
The handle is a file pointer that identifies a file opened with the openfile() statement. If you specify the handle by reference (with the keyword byref), 4GL assigns a negative integer and returns the value to you. If you do not specify byref, 4GL uses the value you provide, which must be a positive integer.
After you close a file, the 4GL-generated handle does not remain. If you specified a handle without byref, you can specify the same handle again for another opening of the file.
The 4GL file access statements require the handle to access the file. A file must have been previously opened with the openfile() statement and the handle must be known to 4GL before any of the other statements can be used. A handle cannot refer to more than one file.
A file must be on a local node to be opened with the openfile() statement.
No 4GL file locking is supported with these statements. See your operating system documentation for information on how your system handles file locking.
The number of files you can have open depends on your operating system and your system configuration. 4GL supports up to 2 gigabytes of handles.
Last modified date: 08/14/2024