keep previous line ending position. when You reach file ending set file position to previous saved position
a do{..}while(..) would also be effective (wouldn't it?)
I guess there is no do-while in MQL4.
I guess there is no do-while in MQL4.
do...while was not implemented
as a rule used while(!feof(some_file))
as a rule used while(!feof(some_file))
while(!FileIsEnding(handle)) { if(FileIsLineEnding(handle)) start_line=FileTell(handle); }
The only time that FileIsEnding(handle) returns true is when the file is closed.
FileSeek(handle,5,SEEK_END);
bEnd1=FileIsEnding(handle); // bEnd1=0
FileSeek(handle,0,SEEK_END);
bEnd2=FileIsEnding(handle); // bEnd2=0
FileClose(handle);
bEnd3=FileIsEnding(handle); // bEnd3=1
Pre Build 184 FileIsEnding() worked.
In the interim determine the FileSize and then append a dummy line of known length so as to extract the last line
of data.
FileSeek(handle,5,SEEK_END);
bEnd1=FileIsEnding(handle); // bEnd1=0
FileSeek(handle,0,SEEK_END);
bEnd2=FileIsEnding(handle); // bEnd2=0
FileClose(handle);
bEnd3=FileIsEnding(handle); // bEnd3=1
Pre Build 184 FileIsEnding() worked.
In the interim determine the FileSize and then append a dummy line of known length so as to extract the last line
of data.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have Date,Time,High,Low,Close,Volume and I want the date. Everything I try does not work. I have this. Can anyone help?
tia