If there are 5 lines in the file. I want to write 3 instead. I move the pointer to the beginning of the file, write 3.... And behind them there are 2 more... So there are 5 lines in the file instead of 3 - shield...
vyv: If there are 5 lines in the file. I want to overwrite them with 3. I move the pointer to the beginning of the file, write 3.... And there are 2 more behind them... So there are 5 lines in the file instead of 3 - a shield...
Open a file with write-only flag FILE_WRITE and write whatever you want. Everything before that will be deleted.
There are some peculiarities of working with read and write flags:
If FILE_READ is specified, an attempt is made to open a file that already exists. If the file does not exist, the file cannot be opened, a new file is not created.
If FILE_READ|FILE_WRITE - a new file is created if there is no file with that name.
If FILE_WRITE - the file is re-created with zero size.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
In your case, you need to use dynamic arrays
Thank you! It works.
Correct, if not difficult, the error in the tester.
Experts are blind when processing a tick. It is impossible to update the information on a symbol during tick processing.
In normal trading this does not happen and all data are updated.
https://www.mql5.com/ru/forum/4270/page2#comment_87059
Without this fix it is impossible to process trade errors correctly.
When, during optimisation, all trades are on the plus side, the xml report file is crooked.
... Please correct it.
Either I don't understand something, or you forgot to make FileClear() function
Now, as I understand it, to clear a file you have to 1 close, 2 delete, 3 open. - This is very inconvenient.
Either I don't understand something, or you forgot to make FileClear() function
Now, as I understand it, to clear a file you have to 1 close, 2 delete, 3 open. - This is very inconvenient.
Why clear the file? Move the file pointer to 0 and start writing.
If there are 5 lines in the file. I want to overwrite them with 3. I move the pointer to the beginning of the file, write 3.... And there are 2 more behind them... So there are 5 lines in the file instead of 3 - a shield...
Open a file with write-only flag FILE_WRITE and write whatever you want. Everything before that will be deleted.
There are some peculiarities of working with read and write flags:
It looks like the FileChangeSize function is needed
The FileChangeSize function seems to be needed
And they also forgot the file/folder renaming functions.
// OK, I agree, you can rename with FileMove(...), but for folders we need an analog too. :)