RecordLOF Function

Purpose

Returns the number of record in a file.

Syntax

nr = RecordLOF[%](# n)

n:iexp
nr:large or integer exp

Description

RecordLOF returns a Large containing the number of records in a random-access file and the number of bytes in normal file.

RecordLOF% returns a 32-bit integer and is only usable for file size < 2GB.

Example

Global age%, firstname$, ct|(5), i%, n1$, n2$, nr|, secondname$

OpenW # 1

Open App.Path & "\Musicians.DAT" for Random As # 1, Len = 52

Field # 1, 24 As firstname$, 24 As secondname$, 4 At(V:age%)

//

For i% = 1 To 5

Read n1$, n2$, age%

Lset firstname$ = n1$

Lset secondname$ = n2$

Put # 1, i%

ct|(i%) = i%

Next i%

Close # 1

Data Harold,Faltemeyer,56,Robin,Williams,32,Barry,Manilow,78,Bryan,Adams,52,Demi,Lovato,21

//

Open App.Path & "\Musicians.DAT" for Random As # 1, Len = 52

Field # 1, 24 As firstname$, 24 As secondname$, 4 At(V:age%)

Print "No of Records in File ="; RecordLOF(# 1)

Close # 1

Kill App.Path & "\Musicians.DAT"  // Tidy-up line

Remarks

See Also

Lof

{Created by Sjouke Hamstra; Last updated: 22/10/2014 by James Gaite}