Premature end-of-file on a loop

I’m using Lucee
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 ?


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

1 Like