Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 597

 
Juer:

Yeah, that's the thing. It's so confusing, the objects are in other objects and it's not so easy to delete already. Some objects depend on others, and those on third objects that depend on the first ones :)

Life is so complicated :(

It's simple, all the objects inside the objects are prescribed deletion in the deconstructor and you don't even have to worry about deleting them. At least, if I create an object inside a class, the first thing I do is write its deletion in the destructor. And only then the weight of the function.
But in general, you have been told correctly. Start to build everything from scratch. And little by little you will find your inaccuracies.

 

Can you tell me if I'm creating a CArrayObj object and adding other objects to it? I still need the objects themselves. And I can delete this list object.

Which method should I use to remove objects from it before deleting? Detach() or Delete()?

Or Clear() / Shutdown() ?

 
Juer:

Can you tell me if I'm creating a CArrayObj object and adding other objects to it? I still need the objects themselves. And I can delete this list object.

Which method should I use to remove objects from it before deleting? Detach() or Delete()?

Or Clear() / Shutdown() ?

You cannot delete an object array, if it contains objects you need.

Where will you get them from, if you delete the object array?

You need the array to access the objects stored in it.

 
Artyom Trishkin:

You can't delete an object array if it contains the objects you want.

Where will you get them from if you delete the object array?

You need the array to access the objects it contains.

I don't need it anymore. I added objects to the array, and performed necessary actions in the array. I only needed this array in a separate function.

I need the objects themselves. Well, you must delete the array's object, right? So, I should remove objects from it first, and then remove them. Here, what is the correct method of clearing the array (without deleting the objects themselves)?

 
Rustam Bikbulatov:

What is the difference between OrderSend(...)>0 and just OrderSend(...) ? I've seen some people put OrderSend(...)<0.

What is the difference? What are comparison signs responsible for?

OrderSend


Juer:

I don't need it anymore. I added objects to an array and performed necessary actions in this array. I only needed this array in a separate function.

I need the objects themselves. Well, you must delete the array's object, right? So, I should remove objects from it first, and then remove them. Here, what is the correct method of clearing the array (without deleting the objects themselves)?

for(int i=0; i<ArraySize(arrayClass); i++)
     if( arrayClass[i] != NULL )
          delete arrayClass[i];
ArrayFree(arrayClass);
 

Ihor Herasko:

1. I already answered this question yesterday. Please don't duplicate the questions.

2. I answer one question from one person a day.

3. I don't have more time.

4.I don't understand why I keep answering your questions at all : )

1. and i answered you yesterday that your answer is inadequate : ) it turns out that i originally hung the barshift on an empty chart?

2. i don't have much fun playing this kind of games : ) may be you will just answer everything at once? it concerns your indices; and i will be eternally grateful to you, considering the urgency ; ) you still have not answered that question and i have not given you a new answer today ; ) yesterday i wrote you specifically: flushes. the question about flushes should have been answered in the first place : )

3. obviously there is, because you're doing charity work in this thread ; )

4. probably because it's your turkeys and owls : )


 

What is the difference betweenOrderSend(...)>0 and just OrderSend(...) ? I've seen some people put OrderSend(...)<0.

What is the difference? What are comparison signs for?

 
Rustam Bikbulatov:

What is the difference between OrderSend(...)>0 and just OrderSend(...) ? I've seen some people put OrderSend(...)<0.

What is the difference? What are comparison signs for?

Put cursor in the editor at OrderSend and press F1, and "Oh, how many wonderful discoveries..." :)

 
Artyom Trishkin:

Put the cursor in the editor on OrderSend and press F1, and "Oh, how many wonderful things we've discovered..." :)

there doesn't seem to be an answer about comparison marks

 
Rustam Bikbulatov:

there doesn't seem to be an answer about comparison marks

What does OrderSend return ?

Returns ticket number, which is assigned to the order by the trade server or -1 in case of failure. To get the errorinformation , you need to call GetLastError().

Isn't that the answer?
Reason: