Features of the mql5 language, subtleties and tricks - page 65 1...585960616263646566676869707172...340 New comment Konstantin 2018.01.15 10:05 #641 how to reduce the size of the file with binary data to the new data size, without removing the file itself, or only through calling external dll can be implemented? TheXpert 2018.01.15 11:12 #642 Konstantin: How to reduce file with binary data to the new data size, without removing the file itself, or only by calling external dll can be implemented?I need an analogue of SetEndOfFile function.It was asked about it about 6 years ago Konstantin 2018.01.15 11:19 #643 Combinator: We need an analogue of the SetEndOfFile function.It was asked about it about 6 years agoThat's what I'm writing about )) because it's not kasher to do it via external dll or file deletion fxsaber 2018.01.15 11:59 #644 Combinator: We need an analogue of the SetEndOfFile function.It was asked about it about 6 years ago.bool SetEndOfFile( const string FileName, const uint Size, const int Commong_Flag = 0 ) { uchar Buffer[]; return((FileLoad(FileName, Buffer, Commong_Flag) > Size) && ArrayResize(Buffer, Size) && FileSave(FileName, Buffer, Commong_Flag))); } Konstantin 2018.01.15 12:21 #645 fxsaber: the file will change its size only upwards, if the data array is reduced, the file will remain the same size fxsaber 2018.01.15 12:27 #646 Konstantin: file will change its size only upwards, if the data array is reduced, the file will remain with the same sizeDecreases. TheXpert 2018.01.15 12:37 #647 fxsaber: That's a hell of an overhead. fxsaber 2018.01.15 13:42 #648 Combinator: That's a hell of an overkill.Absolutely! fxsaber 2018.01.15 14:08 #649 Once again about double Forum on trading, automated trading systems and trading strategies testing Bugs, bugs, questions fxsaber, 2018.01.15 11:53 Because the input fmod is double. Double can't store a huge number of integers. For example, your case:Print(DoubleToString((double)131472503841474907, 0)); // 131472503841474912 Do this.long fmod( const long Value, const long Value2 ) { return(Value % Value2); }Using the float example, you can quickly understand the peculiarity of double#define PRINT(A) Print(#A + " = " + (string)(A)) void OnStart() { for (int i = 0; i < INT_MAX; i++) if ((int)(float)i != i) { PRINT(i); PRINT((float)i); PRINT((double)i); break; } }Resulti = 16777217 (float)i = 16777216.0 (double)i = 16777217.0SZY double doesn't lose the information of the whole int-range, not so with long. Errors, bugs, questions Features of the mql4 Invalid Stops,can't place an TheXpert 2018.01.15 14:25 #650 Konstantin: This is what I'm writing about )) because it's not kasher to do through external dll or delete a filesaw it, wanted to but forgot Ошибки, баги, вопросы 2011.08.01 www.mql5.com Общее обсуждение: Ошибки, баги, вопросы 1...585960616263646566676869707172...340 New comment
how to reduce the size of the file with binary data to the new data size, without removing the file itself, or only through calling external dll can be implemented?
How to reduce file with binary data to the new data size, without removing the file itself, or only by calling external dll can be implemented?
I need an analogue of SetEndOfFile function.
It was asked about it about 6 years ago
We need an analogue of the SetEndOfFile function.
It was asked about it about 6 years ago
That's what I'm writing about )) because it's not kasher to do it via external dll or file deletion
We need an analogue of the SetEndOfFile function.
It was asked about it about 6 years ago.
the file will change its size only upwards, if the data array is reduced, the file will remain the same size
file will change its size only upwards, if the data array is reduced, the file will remain with the same size
Decreases.
That's a hell of an overkill.
Absolutely!
Forum on trading, automated trading systems and trading strategies testing
Bugs, bugs, questions
fxsaber, 2018.01.15 11:53
Because the input fmod is double. Double can't store a huge number of integers. For example, your case:
Do this.
Using the float example, you can quickly understand the peculiarity of double
Result
SZY double doesn't lose the information of the whole int-range, not so with long.
This is what I'm writing about )) because it's not kasher to do through external dll or delete a file
saw it, wanted to but forgot