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

 
SanAlex #:

but if you try it this way - just you need to put all the names in

You don't need to build a spaceship. It's much simpler than that.

 
Artyom Trishkin #:

You don't need to build a spaceship. It's much simpler than that.

no well, there are different situations, sometimes it might be better to remove it that way.

 
SanAlex #:

No well, there are different situations, sometimes it might be better to remove it that way.

Delete it. But it's better to understand the reason once - so that you never do it again.

When you delete an object from an array, the position of the next one moves in the array and the loop index now points to where? Just think.

 
Artyom Trishkin #:

Delete it. But it is better to understand the reason once - so that you never do it again.

When you delete an object from an array, the position of the next one moves in the array and the loop index now points to where? Just think.

as I understand it, this is the array "H2 Arrow 8345", and it also creates an object named "button1", "ArrowUp0008", "ArrowDown0008", "ArrowUp0006", "ArrowDown0006".

 
Nerd Trader #:

I delete all objects in OnDeInit() by loop (arrows indicating signal bars and one button):

I'm aware of ObjectsDeleteAll(), but still if I do it through a loop, only half of the objects are deleted in one. Actually here is the work of the loop and I don't understand why it happens so:

Why would you want to delete through a loop?
 
MakarFX #:
Why would you want to delete through a loop?
For the sake of mischief.)))
 
MakarFX #:
Why do you need to delete through a loop?

well, theObjectsDeleteAll command essentiallydoes the same thing.

and plus, there used to be bugs with it - it didn't fully remove a large number of objects, under certain conditions.

 
Taras Slobodyanik #:

well, theObjectsDeleteAll command essentiallydoes the same thing.

and plus, there used to be bugs with it - it didn't fully remove a large number of objects, under certain conditions.

I've never encountered this before...
 
Taras Slobodyanik #:

well, theObjectsDeleteAll command essentiallydoes the same thing.

and plus, there were bugs with it at one time - it didn't completely remove a large number of objects, under certain conditions.

It was quite the opposite. In OnDeInit(), the Expert Advisor did not have time to delete all objects by the loop. It was discussed here on the forum. The solution is unambiguous, delete everything by prefix...
 
Artyom Trishkin #:

Delete it. But it is better to understand the reason once - so that you never do it again.

When you delete an object from an array, the position of the next one moves in the array and the loop index now points to where? Think it over.

You'd better specify the reason at once, about the shift - I've read it well, I wanted to write it).