Premature end-of-file on a loop

I’m using Lucee 5.3.3.62
Under IIS (Windows Server)
and MSSQL.

I have a loop like this:

// read line
local.line = fileReadLine(local.myFile);

// Loop over JSON file
do {
local.myCat = deserializeJSON(local.line);
. . .
. . .
local.line = fileReadLine(local.myFile);
} while (!fileIsEOF(local.myFile));

I works but skips the last record, it’s having a premature end

Any ideas ?

Thanks.

Sorry guys it was a stupid mistake by initializing the read before the loop.
All fixed, thanks for your time.

1 Like