FileIsLineEnding doesn't reset the EOL flag?
xsgex: FileIsLineEnding on line 2 keeps returning True. What is the work around this?
| while (!FileIsEnding(fh)) { while (!FileIsLineEnding(fh)) { words[i++] = FileReadString(fh); } } |
| Always read until EOF. | while (!FileIsEnding(fh)){ do{ words[i++] = FileReadString(fh); while (!FileIsLineEnding(fh)); // Do something at EOL } //EOF |
| If you don't need to do something at end of line, stop checking for it. | while (!FileIsEnding(fh)){ words[i++] = FileReadString(fh); } //EOF |
whroeder1:
| |
| Always read until EOF. | |
| If you don't need to do something at end of line, stop checking for it. | |
Thanks! The do-while construct is what I needed, and I'm embarrassed that I didn't think of it sooner.
It appears that FileIsLineEnding does not reset the EOL flag when called. This makes it impossible to use it to iterate over lines of text in the following fashion:
The first line is read (and broken down into words), however the second line can not be read, because FileIsLineEnding on line 2 keeps returning True.
What is the work around this?
MetaTrader Version 4.00 Build 1090