Futurebasic/Language/Reference/lof

From Wikibooks, open books for an open world
Jump to navigation Jump to search

LOF[edit | edit source]

Syntax[edit | edit source]

numRecords = LOF(deviceID [,recordLength])

Description[edit | edit source]

If deviceID is the ID number of an open file, LOF returns the total number of records in the file. If deviceID equals _modemPort or _printerPort (and the specified device is open), LOF returns the total number of records currently in the device's input buffer. If there is a "partial" record at the end of the file (or input buffer), it is included in the count.

The returned record count is based on the record length given in recordLength, if it's specified. If this parameter is omitted, LOF uses the record length that was specified in the OPEN statement when the file or the port was opened. If recordLength is omitted and no record length was specified in the OPEN statement, a default record length of 256 is used.

To determine the total number of bytes in the file or in the serial input buffer, use LOF(deviceID,1).

See Also[edit | edit source]

RECORD; REC; LOC; OPEN