
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
Yes, if you remove up to 3 letters
That's not the point.Try to study this or that topic as you need it. Once you get to a point in your system where you need certain "levers" (functions), then start experimenting with them. I found that this method of studying (in my case) works quite well))).
Then we wait for a response from more competent comrades.))
Wait :)
Better yet, don't wait.) Keep experimenting.))
Remove the value from the array when declaring it. It must be like in the help:
string result[];
And you won't have any errors. As I understand it, the entire string specified in to_split variable is placed in the array, and then substring extraction goes on.Better yet, don't wait.) Keep experimenting.))
Remove the value from the array when declaring it. It must be the way it is written in the help:
And there will be no errors. As far as I understood, the entire string specified in the to_split variable is placed in the array and then substring extraction is performed.It's clear. Only this is a potential pitfall - I actually encountered this error in my code and it works - with an error.
For example, here is the help text for CopyBuffer
Where is the logic? I mean, what is the difference with StringSplit?
And if you make all arrays dynamic, you will run out of memory.
Upgr ArrayResize with zeroing is a variant, of course, but I don't like it.
As I understand it, the entire string specified in the to_split variable is placed in the array, and then the substring is extracted.
In your example, the problem is that the StringSplit() function itself takes care of the required amount of memory in the array passed as a parameter.
So it turns out that a static array works (if there is enough memory) but causes an error because people try to re-partition it.
Try the static and distributed dynamic arrays, and you'll see:
Try the variant with static and distributed dynamic arrays and it will become clear:
To try the dynamic array, just uncomment ArrayResize(result,3); ? If so, there will be a warning on compilation:
To try a dynamic array, just uncomment ArrayResize(result,3); ? If so, there's a warning on compilation:
is this an unsolvable problem ? make it dynamic.
In your example, the problem is that the StringSplit() function itself takes care of the required amount of memory in the array passed as a parameter.
This is why a static array works (if there is enough memory), but causes an error because people try to re-partition it.
So, can we use StringSplit() with static arrays or not?
If you can, there shouldn't be an error if there is enough memory. If not, it shouldn't work.