LOF()
This page was last modified 05:05, 2 June 2020 by Mars2000you. Based on work by NYYRIKKI.

Contents

Effect

Returns the size of a file on disk in bytes.

The file needs to be opened before using this function otherwise the "File not OPEN" error message will be displayed.

Syntax

LOF(<FileNumber>)

Parameter

<FileNumber> corresponds to the number assigned to the file when opened with the OPEN instruction. It can vary between 1 and 15, but can't exceed the maximum number of files eventually defined with MAXFILES.

Example

10 INPUT "Filename: "; FI$
20 OPEN FI$ FOR INPUT AS #1
30 PRINT LOF(1) "Bytes"
40 CLOSE

Related to

GET, LOC(), MAXFILES, OPEN, PUT

Compatibility

Disk BASIC 1.0 or higher