switch, case, and const int New comment Florin Ionescu 2010.07.08 16:52 I don't know if this is a bug or not.I read that in case there must be a constant value. I tried to define some constant int value, and put it into case statement like this:const int MENU_SHOW 1; //... switch (menu_action) { //... case MENU_SHOW: ObjectSetInteger(0,prefix+"Edit",OBJPROP_TIMEFRAMES,OBJ_ALL_PERIODS); printf("menu L (1)"); break; //... } What was confusing was that mql5 compiled ok.But what I wrote doesn't work.It must be really a constant like in the manual.Wouldn't mql5 refuse to compile in the case above? Get in touch with developers using Service Desk! www.mql5.com We therefore attach great importance to all user reports about issues in our programs and try to answer each one of them. Errors, bugs, questions [Is this a bug?] Order of initialization Questions from a "dummy" Slava 2010.07.08 18:49 #1 #define MENU_SHOW 1 Test Account 2010.07.08 19:03 #2 Thank you.We will check it. Florin Ionescu 2010.07.12 15:30 #3 stringo: Thanks for suggestion.I thought of #define from c, but I didn't arrive to try it. Good it's possible. New comment
I don't know if this is a bug or not.
I read that in case there must be a constant value.
I tried to define some constant int value, and put it into case statement like this:
What was confusing was that mql5 compiled ok.
But what I wrote doesn't work.
It must be really a constant like in the manual.
Wouldn't mql5 refuse to compile in the case above?