Well this is the intended behaviour. What can you read from a file that does not exist?
virusx1984: so the file that exists can't be append?
| Of course you can; open read/write and seek to the end. |
WHRoeder:
Thank you! How to seek to the end? Could you give me an example?
virusx1984: so the file that exists can't be append? | Of course you can; open read/write and seek to the end. |
virusx1984: How to seek to the end? Could you give me an example?
- RTFM List of MQL4 Functions - MQL4 Documentation -> File Functions - MQL4 Documentation -> FileSeek - MQL4 Documentation
- RTFB MQL4 Tutorial -> File Operations - Standard Functions - MQL4 Tutorial -> FileSeek - MQL4 Documentation
int CREATE = FILE_WRITE|FILE_TXT|FILE_ANSI; int APPEND = FILE_READ|CREATE; string fileName = WindowExpertName() + ".DBG"; HANDLE handle = FileOpen(fileName, APPEND); if(handle != INVALID_HANDLE){ FileSeek(handle, 0, SEEK_END); FileWrite(handle, s); FileClose(handle);
Is that so hard?
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 saw in the MQL4 Document: