FileIsLineEnding

 

If I have failed to close an order then I write to an error log a ticket # and magic number in a string.

The file will always exist but will normally be empty.

I am trying to read the error file in a loop which starts with the following code. I would anticipate this this to be true and ignore the code inside the WHILE Loop but it appears to proceed into the loop then generate an error when I try and read a string using FileReadString - I get error: 4099 end of file. I might as well just ignore the FileIsLineEnding and check for error 4099 when I try and read the string. Any ideas?

while (FileIsLineEnding(My_FileClose_Handle) == FALSE ) 

 

FileIsLineEnding() != FileIsEnding()

Are you checking your CSV file for the end of the line or end of the file ? if your file is empty I don't think you can have an end of line . . you don't have any lines, but you can have an end of file.

 
RaptorUK:

FileIsLineEnding() != FileIsEnding()

Are you checking your CSV file for the end of the line or end of the file ? if your file is empty I don't think you can have an end of line . . you don't have any lines, but you can have an end of file.


Yes it is CSV.

I'll try FileIsEnding

 
peterhw1:

Yes it is CSV.

I'll try FileIsEnding

In practice my files have been written with a Blank last line - i.e. each line is written with a CR/LF and so the last line read is Blank or == "". So testing for this occurrence happens before EOF.


Looks like sorted but thanks - as always - for prompt and helpful response
 
peterhw1:

In practice my files have been written with a Blank last line - i.e. each line is written with a CR/LF and so the last line read is Blank or == "". So testing for this occurrence happens before EOF.


Looks like sorted but thanks - as always - for prompt and helpful response
You are, as usual, most welcome :-)