How can I make to write an info into the text file without knowing the number of this infos?
Thanks you, I had not looked the good function, but it still a question; when I create a CSV file, there is ";" between each datas and line, it is normal for the excel program will reconize it
But I just want a text file, so I use FILE_BIN and before the carriage return, there is a caracter like a 0 or O, how can I make to delete it or to not write it?
See the attached file to know what I mean...
int start() { //---- int handle; datetime date = Time[0]; string str="some string"; handle=FileOpen("filename.txt", FILE_BIN|FILE_WRITE); if(handle<1) { Print("can\'t open file error-",GetLastError()); return(0); } for (int i=0; i<=5; i++) { FileWrite(handle, TimeToStr(date), "Ligne n° ", i, str, "\r\n"); } //FileClose(handle); //---- return(0); }
Thanks you, I had not looked the good function, but it still a question; when I create a CSV file, there is ";" between each datas and line, it is normal for the excel program will reconize it
But I just want a text file, so I use FILE_BIN and before the carriage return, there is a caracter like a 0 or O, how can I make to delete it or to not write it?
Like this ...
int start(){ int handle; datetime date = Time[0]; string str="some string"; handle=FileOpen("filename.txt", FILE_WRITE, " "); if( handle<1 ){ Print("can\'t open file error-",GetLastError()); return(0); } for( int i=0; i<=5; i++ ){ FileWrite(handle, TimeToStr(date), "Ligne n° ", i, str); } FileClose(handle); return(0); }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Good night or good morning accordingt to where you are.
I am testing an EA I am coding and I use the print function to know what it is doing in order to debug it but it's appear to be heavy because there is news informations every ticks and the automatic refersh is a little boring even if I can disable it.
But I want also write importants informations once the EA wil be finish. So, I want now writing any informations (only string for the moment) into a txt file like.
==> I have copied the template for this site but I would have some help to write an info at the following of the other and in the example the number of infos are predeterminated.
How can I make to write an info into the text file without knowing the number of this infos?