
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
What about the normal names that are in the comments?
By the way, there seems to be an error in the mql preprocessor.
expands to 'i nt ll;' and gives an error:
'i nt' - undeclared identifier t_t_t.mq4 50 1
Regarding the comments in the enumeration - supposedly they should be twitching up to the C preprocessor. So even if it was possible to cram a comment in, it would be unlikely to have an effect. In a good way, you should change the syntax (to _cmnt_, for example) and change the call sequence of the C preprocessor with the preprocessor that pulls the comments. Prospects for such reforms are unlikely, I think ))
By the way, there seems to be an error in the mql preprocessor.
expands to 'i nt ll;' and gives an error:
Dynamic ENUM is for internal use, the settings window doesn't show these. Normal names/comments are not really needed
The last method required to write the blanks manually for enum and the function that returns an array of values. I decided to figure it out and write it in such a way that it is no longer needed. However, it cannot be compiled in mql, there are no macros with variable number of arguments, but theoretically they can appear. Anyway, here's what I've got:
Выхлоп printf:
----enum1-----
1
3
65
90
----enum2-----
100
-3
21
----enum3-----
871
213
226
// Generated code for emum1
// enum enum1{
// q = 1,
// e = 3,
// t = 65,
// z = 90,
// };
// unsigned get_enum1_array(int *ar){
// int temp[] = { q, e, t, z, };
// if(ar != NULL)
// for(unsigned i = 0; i < sizeof(temp) / sizeof(int); ++i){
// ar[i] = temp[i]; }
// return sizeof(temp) / sizeof(int);
// }
Article on this subject http://jhnet.co.uk/articles/cpp_magic. All in all, a lot of magic, of course. But the technique can be useful for a wide range of tasks referring to preprocessor code generation.
I read the thread with interest, all very cool with macros.
It's just not clear, why do we need all this dancing with enum? Can you give a practical example?
It's clear about TF, but what else?
However it cannot be compiled in mql, there are no macros with variable number of arguments, but theoretically they can appear.
In MQL5 macros not only have a fixed number of arguments, but their number is limited to 8. So you can make an enum for only 3 values.
As for theoretical appearance, it will probably be faster to get an in-house function for enum parsing, as the developers have already promised to do something.
In MQL5 macros not only have a fixed number of arguments, but the number of arguments is limited to 8. So we can make an enum for only 3 values.
As for the theoretical appearance, it's probably faster to get an in-house function for enum parsing. The developers have already promised to come up with something.
Use previously proposed method of enumeration using array.
No iterator is planned for enumerator value enumeration.
Use the previously suggested method of enumerating values using an array.