Questions from Beginners MQL5 MT5 MetaTrader 5 - page 975
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
Artyom Trishkin:
This seems to be the case:
SZY. Help has nothing to do with it. It has nothing to do with logic.
Explain where the operation C=C is present
ZS. logic does not work for some reason)
Explain where the operation C=C is present
ZS. The logic does not work for some reason)
Knowing Artyom, I have no doubt that he wrote it correctly, I just want to try to explain in a slightly different way.
Knowing Artyom, I don't doubt he's got it right, I just want to try and explain it in a slightly different way.
Thank you!
Explain where the operation C=C is present
ZS. logic doesn't work for some reason)
In this:
ZS. It's working.In this one:
ZS. It's working.Thank you!
How do I search in an object array?
Here's how I search through my object array CArrayObj. The task is to find an instance with a value returned by one of the methods, equal to the given one (offset). I do it with full brute force, which turns out to be very long, because of huge number of elements in the array. How to do it correctly?
In C#, this is easy:
Find (x=>x.method()==value)
And it doesn't even matter if the list is sorted or not. But how to do it here? I haven't found any ready-made methods in CList either.
How do you search through an array of objects?
Here's how I search my array of CArrayObj objects. The task is to find an instance with value returned by one of methods, equal to the given one (offset). I'm doing this with full search, which turns out very long, because of the huge number of elements in the array. What should I do correctly?
In C# this is done simply:
Find (x=>x.method()==value)
And it doesn't even matter if the list is sorted or not. But how to do it here? I haven't found any ready-made methods in CList either.
offset I have here is unique. Would CHashMap help me? But it's so complicated... :(
But it's still not clear. My object has a bunch of methods. How do I get a pointer to the object?
The offset I have here is unique. CHashMap will probably help me? But it's complicated... :(
But it's still not clear. My object has a lot of methods. How can I get a pointer to an object?
... The task is to find an instance with a value returned by one of the methods equal to the given one (offset). I'm doing it with brute force, which takes a very long time, due to huge number of elements in the array. ...
It is easy to do this in C#:
Find (x=>x.method()==value)
And it doesn't even matter if the list is sorted or not.
And in C#, does this lambda-expression, with the help of some magic, work straightforwardly?
If method() returns the same value - search through the dictionary. If the value is different each time - only a full search each time.
And in C#, does this lambda-expression, with the help of some magic, work straightforwardly?
If method() returns the same value - search through the dictionary. If the value is different each time - only a full search each time.
Well, yes, there is a Linq. Identical values. Yes, I'm catching a crash on one of my machines. Code is the same everywhere.
On adding m_dict.AddObject(str_array[0],field);