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
If the number of objects is known beforehand and it is constant during the running of the program, then new is not needed. In all other cases, you need new.
No, here is my examplehttps://www.mql5.com/ru/forum/160683/page861#comment_11840254
it's convenient to pass parameters to the constructor and if the user changes the settings, it's faster to kill the class in OnDeinit() and then create it with the new parameters in OnInit()
;)
no, here is my examplehttps://www.mql5.com/ru/forum/160683/page861#comment_11840254
it is convenient to pass parameters to the constructor and if the user changes the settings, it's faster to kill the class in OnDeinit() and then create it with the new parameters in OnInit()
;)
Parameters can also be passed to the constructor without new.
Parameters can be passed to the constructor without new.
So, how will you change class fields (user changed EA settings)? - Will you write one more method? I thought on the last page you were fighting for"one morevariable for a pointer."and here you have a whole method!
;)
and? and how will you change class fields (user changed EA settings)? - Will you write another method? I thought on the last page you were fighting for"one morevariable for the pointer." you were struggling with, and here's a whole method!
;)
no way ;)
change the EA settings
no way ;)
change EA settings
Cool ambush.
However, I would prefer to add a method to change the parameters, but not use new just because of the parameters.Cool ambush.
Nevertheless, I prefer to add a method to change parameters, but don't use new just because of parameters.not using new is a superstition? )))
imho, if it is convenient, you must use it! - Your example will be rewritten in 2 clicks using new and everything will work correctly and handle situation when user changes settings
not using new is superstition? )))
imho, if it is convenient, you must use it! - Your example will rewrite in 2 clicks using new and everything will work correctly and handle situation when user changes settings
Not superstition, just laziness, historically, due to circumstances. You have to write delete and do it in Deinit(). But the Deinit() function was not present in the template by default. Now I look - the EA template has Deinit(), but it was not there before.
Not superstition, just laziness, historically, due to circumstances. We should write delete, and do it in Deinit(). But the Deinit() function was not present in the template by default. I am looking now - there is Deinit() in the EA template, but it was not there before.
Do not write delete - everything will work correctly, this sin (I mean superstition) ) ) will take over the terminal and will mutter in the log "48 bytes of leaked memory", "2 objects of type CX left" and "undeleted objects left".
HH: in the indicator template there is no Deinit() - this is annoying
do not write delete - everything will work correctly, this sin (I mean superstition)) ) will take over the terminal and will mutter in its log "48 bytes of leaked memory", then "2 objects of type CX left" and "undeleted objects left"
SZY: in a template of creation of the indicator there is no Deinit() - it strains
It will work without delete, but it's useless. But does the terminal take care of this problem? It only reports memory leaks, but it doesn't devote the same objects.