QBasic 1.1: FILEATTR Function
Explanation
FILEATTR Function
Returns information about an open file.
Worth knowing
Useful and cross-version information about the programming environments of QBasic, QuickBasic and Visual Basic for DOS.
Syntax
FILEATTR(filenumber%,attribute%) |
Description / Parameter(s)
filenumber% |
The number of an open file. |
attribute% |
Specifies the type of information to return. When attribute% is 1, FILEATTR returns a value indicating the file's access mode: |
|
Value | Mode |
1 | Input |
2 | Output |
4 | Random |
8 | Append |
32 | Binary |
|
|
When attribute% is 2, FILEATTR returns the DOS file handle. |
Example
OPEN "TEST.DAT" FOR BINARY AS #1
PRINT FILEATTR(1, 1)
CLOSE