[Coco] File Size

coco at jechar.ca coco at jechar.ca
Tue Feb 14 11:59:42 EST 2023


That is what I had tried before asking it failed.
I think perhaps I need to read record after record counting how many I 
have read so far
and have an ON ERROR to detect the EOF. Unless anyone has any other 
ideas.

On 2023-02-14 11:04, Allen Huffman via Coco wrote:
> On Feb 14, 2023, at 9:59 AM, William Astle via Coco
> <coco at maltedmedia.com> wrote:
>> 
>> You can also "cheat" it by opening the file in "R" (or "D") mode with 
>> a 1 byte record size, then use LOF() to get the number of records, 
>> then close the file again.
>> 
>> OPEN "R",#1,"FILE.EXT",1
>> L=LOF(1)
>> CLOSE #1
>> 
>> Which basically makes the Disk Basic ROM do exactly what Allen 
>> described.
> 
> I retract my answer!
> 
> As I look through my article draft, I see I discuss LOF! I just didn’t
> remember. D'oh!


More information about the Coco mailing list