conststring text[] = { "ABC", "", "ABC" };
uchar array[];
int start = 0;
int n = 0;
for(int i=0; i < ArraySize(text); i++)
{
constint count = StringLen(text[i])+1;
Print(count);
n += StringToCharArray(text[i], array, start, count);
start += count;
}
Print(ArraySize(array), ":", n );
2021.05.2422:56:35.959 Test (AUDUSD,M5) 42021.05.2422:56:35.959 Test (AUDUSD,M5) 12021.05.2422:56:35.959 Test (AUDUSD,M5) 42021.05.2422:56:35.959 Test (AUDUSD,M5) 9:9
If it is initialised, then why does the execution
error 4009
ERR_NOTINITIALIZED_STRING
4009
Uninitialized string
This is a matter of terminology.
That's not the problem, it's the fact that this code returns 4 and should return 0.
This just means that -1 and 0 have the same result. The same result will probably give INT_MAX and something else.
Knowing/knowing some of the features of the regular functions is fine.
It's ok to know/know some features of regular functions.Of course. Especially when the feature is a bug ))
Well and unequivocally add to the branch"Features of mql5language..."
It just means that -1 and 0 have the same result.
If you think this is logical and correct, I think it makes you wonder if your logic is logical
Of course. Especially when the feature is a bug ))
Well and definitely add to the branch"Peculiarities of mql5language...".
Tweak documentation a bit and it's no longer a bug.
If you think it is logical and correct, I think this is a reason to think about the logic of your logic.
Philosophy is far from practice.
+1 is unnecessary because a clean copy (without terminating null characters) is required. If you want to prove it is not a bug, you need arguments
requires a clean copy (no terminating null characters)
This is a very bearded design.
WZ
Tweak the documentation a bit and it's no longer a bug.
Philosophy is far from practice.
And how will the practitioner explain such a contradictory result to the theorists:
Result: 4:0
Expectation: 0:0
Or will they correct documentation a bit too? Well, not to fix bugs after all!
My explanation is simple: there is a bug in one of these standard functions - and I even know which one
And how would a practitioner explain such a result to a theorist?
My explanation is simple: one of these functions has a bug - and I even know which one.
The bug is a discrepancy between these two functions, not their result, because it's just a matter of documentation what to output when count=0.