OOP, templates and macros in mql5, subtleties and uses - page 20

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
How do I remove the limit of 8 elements in the number of macro arguments, I am short of 8 elements?
A macro in a macro should be written.
Why not just write functions?
is there a way to remove/delete the const modifier with a macro ? and disable it when needed ?
ZS: there is a code:
decided to write in a file fields of a class, and restore from a file through the constructor, but the modifier const will interfere with this
the code is almost finished, in theory i can delete all const, but... But I don't want to lose an opportunity of further modification, and const is very helpful during code modifications
is it possible to use a macro to remove/delete the const modifier ? and disable it when needed ?
Hmm, that simple?!
how do I limit the section of the source code where I want to apply the macro?
how do I limit the area of the source code where I want to apply the macro?
is it possible to use a macro to remove/delete the const modifier ? and disable it when needed ?
ZS: there is a code:
decided to write in file fields of class, and restore from file through constructor, but const modifier will interfere with this
the code is almost finished, in theory i can delete all const, but... But I don't want to lose an opportunity of further modification, and const is very helpful during code modifications
What's the idea? Everywhere c_cmd is a constant and one function is not a constant? If so, it's UB (yes μl won't allow to do so), well there because of read only segments, compiler optimizations ...
Hmm, simple again.
THANK YOU!
What's the idea? Is c_cmd a constant everywhere and one function is not a constant? If so, it's UB (yes μl won't allow to do so), well there because of read only segments, compiler optimizations ...
I decided to save all the fields of 2 classes with all settings and current states in them when placing a new order (multi-order TS).
I have decided to use a separate structure with fields by field names of classes to be saved - I will just copy the structure in 2 minutes in the editor))), and it is convenient to save the fields with a single call of FileWriteStruct()
and to restore state I will use this constructor for example:
in this constructor call, constant fields can be initialized
restoring of data is only needed to reload the terminal
I haven't done it yet, but I'm 99% sure it will work without problems - I didn't want to introduce a new data type (storage structure) - but it will be easier and I can read the code later....commentary is not ours to write - ))))
Hmm, simple again.
THANK YOU!
I decided to save all the fields of 2 classes with all settings and current states in them when placing a new order (multi-order TS).
I have decided to use a separate structure with fields by field names of classes to be saved - I will just copy the structure in 2 minutes in the editor))), and it is convenient to save the fields with a single call of FileWriteStruct()
and to restore state I will use this constructor for example:
when this constructor is called, constant fields can be initialized
restoring of data is only needed to reload the terminal
I haven't done it yet, but I'm 99% sure it will work without problems - I didn't want to introduce a new data type (storage structure) - but it will be easier and I can read the code later....comments are not ours to write - ))))