Download MetaTrader 5

FileIsLineEnding problem

To add comments, please log in or register
Publish your article. Millions of traders are looking for good ideas!
Bogdan Alin Baltatu
2924
Bogdan Alin Baltatu 2009.12.30 23:57 

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.
Slawa
Moderator
6842
Slawa 2009.12.31 19:58  

Build number please

Bogdan Alin Baltatu
2924
Bogdan Alin Baltatu 2009.12.31 20:03  

MT5 Build 234

MetaEditor Build 222

Slawa
Moderator
6842
Slawa 2010.01.04 11:35  

FileIsLineEnding flagged when you read file. Seeking is not reading

To add comments, please log in or register