[in] Количество элементов массива для копирования. Определяет длину результатной строки.
По умолчанию -1, что означает копирование до конца массива, либо до встречи терминального 0.
Терминальный 0 также будет скопирован в массив-приемник,
при этом размер динамического массива может быть увеличен при необходимости под размер строки.
Если размер динамического массива больше длины строки, то размер массива уменьшен не будет.
automatic progress )) what confuses the user more.
A100:
And how would a practitioner explain such a contradictory result to theorists?
Result: 4:0
Expected result: 0:0
Or also - to correct documentation a bit? Well, not to fix bugs after all!
My explanation is simple: one of these standard functions has a bug - and I even know which one
After that the Developers have alreadycorrected, so your previous explanation is no good
The functions are the same (differ only in type, in fact the template), the description is the same (there are even cross-references), but the result is different
2021.05.2502:08:33.329 Test (AUDUSD,M1) StringToCharArray 32021.05.2502:08:33.329 Test (AUDUSD,M1) ch[] ABC
2021.05.2502:08:33.329 Test (AUDUSD,M1) GetLastError0
But if you pass 0 into count, the entire string with an ending zero will be copied automatically. Even if the string is empty, an ending zero will be copied.
But if you pass 0 to count, the whole string with an ending zero will be copied automatically. Even if the string is empty, the ending zero will be copied.
Why is it different inStringToShortArray? Please briefly explain without unnecessary cunning and inexplicable references to your earlier brilliant explanations (which failed in the end) - in simple terms - for a dummie
without ; ) and other inappropriate symbols in this topic.
Why is it different inStringToShortArray? Please explain in brief, if possible, without any tricks and incomprehensible references to your earlier brilliant explanations (which failed in the end) - in simple terms - for a dummie
without ; ) and other irrelevant symbols in this topic.
2021.05.2503:10:07.696 Test (AUDUSD,M1) StringToShortArray32021.05.2503:10:07.696 Test (AUDUSD,M1) sh[] ABC
2021.05.2503:10:07.696 Test (AUDUSD,M1) GetLastError0
I don't know why count 0 doesn't work. Maybe this smart automatic on count 0 does not work here, and according to the help, it already is a mismatch. And it must be an error.
2021.05.2503:12:00.176 Test (AUDUSD,M1) StringToShortArray02021.05.2503:12:00.176 Test (AUDUSD,M1) GetLastError0
Anyway, either there is an error here thatdoes not work oncount 0, or there is an error in StringToCharArray thatworksoncount 0.
To make you understand the soundness of explanations, study the basics of the C language, especially handling strings. Then there will be no questions.
Of course it's genius. The help doesn't explicitly disclose handling ofcount 0. But if you turn your head, passing a zero size to the array and allocating zero memory to it is strange, to put it mildly. That's whycount 0 triggers automatic resizing to the end of the string. By logic, it should work in StringToShortArray as well. The error would have been returned better, without any resizing.
Roman: Of course it's genius. Help does not explicitly disclose handling ofcount 0. But if you turn your head, passing a zero array size and allocating zero memory to it is strange, to put it mildly. That's why count 0 triggers automatic resizing to the end of the string. By logic, it should work in StringToShortArray as well. They'd better return an error without any resizing.
Probably because there is no [out] dynamic array inCharArrayToString. And the developer decided that this was unnecessary. Although different logic in similar functions causes more confusion.
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.
The bug is the discrepancy between the two functions, not the result, because it's just a matter of documentation what to output when count=0.
No, there is also such a thing as uniformity principle. the bug is obvious. if you don't understand why it is a bug, that's your problem.
The bug is the mismatch between the two functions, not their result, as it's just a matter of documentation what to output when count=0.
Forum on trading, automated trading systems and strategy testing
Errors, Bugs, Questions
Roman, 2021.05.07 22:07
The whole trick is in the function description ))
automatic progress ))
what confuses the user more.
And how would a practitioner explain such a contradictory result to theorists?
Result: 4:0
Expected result: 0:0
Or also - to correct documentation a bit? Well, not to fix bugs after all!
My explanation is simple: one of these standard functions has a bug - and I even know which one
After that the Developers have alreadycorrected, so your previous explanation is no good
The functions are the same (differ only in type, in fact the template), the description is the same (there are even cross-references), but the result is different
The Developers have already fixed it, so your previous explanation does not work
What exactly has been fixed?

It's always been like it is in the documentation.
Did you check what was fixed? ))
Fixed, split as you wanted.
3 characters, for example.
But if you pass 0 into count, the entire string with an ending zero will be copied automatically.
And StringLen() does not return a terminating zero ))Even if the string is empty, an ending zero will be copied.
What exactly did you fix?
But if you pass 0 to count, the whole string with an ending zero will be copied automatically.
Even if the string is empty, the ending zero will be copied.
Why is it different inStringToShortArray? Please briefly explain without unnecessary cunning and inexplicable references to your earlier brilliant explanations (which failed in the end) - in simple terms - for a dummie
without ; ) and other inappropriate symbols in this topic.
Why is it different inStringToShortArray? Please explain in brief, if possible, without any tricks and incomprehensible references to your earlier brilliant explanations (which failed in the end) - in simple terms - for a dummie
without ; ) and other irrelevant symbols in this topic.
Split works
I don't know why count 0 doesn't work.
Maybe this smart automatic on count 0 does not work here, and according to the help, it already is a mismatch.
And it must be an error.
Anyway, either there is an error here thatdoes not work oncount 0,
or there is an error in StringToCharArray thatworksoncount 0.
To make you understand the soundness of explanations, study the basics of the C language, especially handling strings.
Then there will be no questions.
In short, either there's an error here that count 0 doesn't work,
or there's an error in StringToCharArray that count 0 does work.
Brilliant!
Brilliant!
But if you turn your head, passing a zero size to the array and allocating zero memory to it is strange, to put it mildly.
That's whycount 0 triggers automatic resizing to the end of the string.
By logic, it should work in StringToShortArray as well.
The error would have been returned better, without any resizing.
Of course it's genius. Help does not explicitly disclose handling ofcount 0.
But if you turn your head, passing a zero array size and allocating zero memory to it is strange, to put it mildly.
That's why count 0 triggers automatic resizing to the end of the string.
By logic, it should work in StringToShortArray as well.
They'd better return an error without any resizing.
And in
CharArrayToStringWhy not all the way to the end?
Result: ""
And in
Why not all the way to the end?
Result: ""
Probably because there is no [out] dynamic array inCharArrayToString.
And the developer decided that this was unnecessary.
Although different logic in similar functions causes more confusion.