Warning In conversion

 
Hi,Coders can anyone fixed warning in return section ?
//+------------------------------------------------------------------+
//| Findoud How much order Open in Trade window                      |
//+------------------------------------------------------------------+
int GetOrderNum()
  {
   string comment;
   for(int i=OrdersTotal()-1;i>=0;i--)
     {
      bool select=OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
      if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber)
        {
         comment=OrderComment();
         break;
        }
     }

   string result[];
   ushort u_sep=StringGetCharacter("_",0);
   int k=StringSplit(comment,u_sep,result);
   return(StringToInteger(result[1]));//  warning this section 
  }
Files:
dcdcdc.JPG  55 kb
 

You need to add (int), because the result of StringToInteger command is long type

//+------------------------------------------------------------------+
//| Findoud How much order Open in Trade window                      |
//+------------------------------------------------------------------+
int GetOrderNum()
  {
   string comment;
   for(int i=OrdersTotal()-1;i>=0;i--)
     {
      bool select=OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
      if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber)
        {
         comment=OrderComment();
         break;
        }
     }

   string result[];
   ushort u_sep=StringGetCharacter("_",0);
   int k=StringSplit(comment,u_sep,result);
   return((int)StringToInteger(result[1]));//  warning this section 
  }
 
biantoro kunarto:

You need to add (int), because the result of StringToInteger command is long type

Yes Its working ..... :)  Thank you Biantoro Kunarto.
 
komoles:
Yes Its working ..... :)  Thank you Biantoro Kunarto.
You're welcome
Reason: