1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-26 15:35:53 +00:00
QB64-PE/internal/help/LOF.txt
SMcNeill 6e01fc8dce Altered string compare routines (<,<=,>,>=) so they don't give false results with CHR$(0).
Added new _STRCMP and _STRICMP commands for quick string comparisons.
Cleaned up QB64 to finish removing the QUI (quick user insert) code and folders.
Altered UCASE and LCASE routines to be faster in some situations for us.
2014-09-22 08:19:03 -04:00

31 lines
874 B
Plaintext

The '''LOF''' Function is used to find the length of an [[OPEN]] file in bytes.
{{PageSyntax}}
:: bytes% = LOF(filenumber%)
* LOF returns the number of bytes in an OPENed designated filenumber. File is empty if it returns 0.
* Filenumber is the number of the opened file. # is not required.
* Often used to determine the number of records in a [[RANDOM]] access file.
* Can also be used to avoid reading an empty file, which would create an error.
* LOF in '''QB64''' can return up to 9223372036 gigabyte file sizes.
''Example:'' Finding the number of records in a RANDOM file using a [[TYPE]] variable.
{{CodeStart}}
OPEN file$ FOR RANDOM AS #1 LEN = {{Cl|LEN}}(Type_variable)
NumRecords% = {{Cl|LOF}}(1) \ RecordLEN%
{{CodeEnd}}
''See Example:'' [[INPUT (file mode)]]
''See also:''
* [[LEN]], [[EOF]], [[BINARY]], [[RANDOM]], [[TYPE]]
{{PageNavigation}}