Download MetaTrader 5

FileIsLineEnding problem

To add comments, please log in or register
Bogdan Alin Baltatu
2938
Bogdan Alin Baltatu  

I have a .txt file with 2 line

I run the code and FileInLineEnding return false every time.I open the file with notepad++ and i see [CR][LF] caracters on the end of first line.It is a bug ?

int fh=FileOpen("Test.txt",FILE_READ|FILE_WRITE|FILE_TXT);
   //FileWriteString(fh,"abcdef\nabcdef");
   long fs=FileSize(fh);
   Print("FileSize;",fs);
   for (int i=1;i<=fs;i++)
   {
      FileSeek(fh,i,SEEK_SET);
      if (FileIsLineEnding(fh)==true)
      {
         Print("CR pe pozitia ",i);
      } else Print("i=",i);
      if (FileIsEnding(fh)==true) Print("FileEnding");
   }
Get in touch with developers using Service Desk!
  • www.mql5.com
We therefore attach great importance to all user reports about issues in our programs and try to answer each one of them.
Slava
Moderator
6924
Slava  

Build number please

Bogdan Alin Baltatu
2938
Bogdan Alin Baltatu  

MT5 Build 234

MetaEditor Build 222

Slava
Moderator
6924
Slava  

FileIsLineEnding flagged when you read file. Seeking is not reading

To add comments, please log in or register