Help fixing an old version of a code

To add comments, please log in or register
Alberto Tugnoli
158
Alberto Tugnoli  

Hey, can someone please fix this error please. 


After compiling i got: 'iM' - Illegal switch expression type


Thanks


double iM =MarketInfo(Symbol(),MODE_PROFITCALCMODE);
switch(iM)
{
   case 0:sMarket = "FOREX";break;
   case 1:sMarket = "CFD";break;
   case 2:sMarket = "Futures";break;
   default:sMarket = iM;
}

Eleni Anna Branou
Moderator
6560
Eleni Anna Branou  
Alberto Tugnoli:

Hey, can someone please fix this error please. 

Use the </> button to insert your code.


Petr Nosek
1192
Petr Nosek  
Alberto Tugnoli:

Hey, can someone please fix this error please. 


I've fixed it for free :D

   int iM = (int) MarketInfo(Symbol(),MODE_PROFITCALCMODE);
   switch(iM)
     { 
      case 0:sMarket = "FOREX";break;
      case 1:sMarket = "CFD";break;
      case 2:sMarket = "Futures";break;
      default:sMarket = IntegerToString(iM);
     }
Alberto Tugnoli
158
Alberto Tugnoli  
Petr Nosek:

I've fixed it for free :D

Thank you Petr

To add comments, please log in or register