Why am I getting the warning "implicit conversion from 'string' to 'number"?

 
//Trying to get the shift value of a vertical line whose name is stored in the variable VertName.
   long PriceDateLong = ObjectGetInteger(0,VertName,OBJPROP_TIME,0);
   long PriceDateString = IntegerToString(PriceDateLong);
   int PriceLeftShift = iBarShift(NULL,0,PriceDateString,false);
   Print("PriceDate ",PriceLeftShift);
Though, the program serves the purpose for which it is intended. But I am not comfortable with the warning "implicit conversion from string to number. How to remove please.?
 

PriceDateString should be declared as string since you asign it a value from string type.

string PriceDateString = IntegerToString(PriceDateLong);

int PriceLeftShift = iBarShift(NULL,0,StringToInteger(PriceDateString),false);

or better

//Trying to get the shift value of a vertical line whose name is stored in the variable VertName.
   long PriceDateLong = ObjectGetInteger(0,VertName,OBJPROP_TIME,0);
   long PriceDateString = PriceDateLong;
   int PriceLeftShift = iBarShift(NULL,0,PriceDateString,false);
   Print("PriceDate ",PriceLeftShift);

or best 

//Trying to get the shift value of a vertical line whose name is stored in the variable VertName.
   long PriceDateLong = ObjectGetInteger(0,VertName,OBJPROP_TIME,0);
   // long PriceDateString = IntegerToString(PriceDateLong);
   int PriceLeftShift = iBarShift(NULL,0,PriceDateLong,false);
   Print("PriceDate ",PriceLeftShift);
 
Why are you converting the datetime from VertName to a string and then back to a long and then back to a datetime? Just use it in iBarShift.
 
Nikolay Georgiev:

PriceDateString should be declared as string since you asign it a value from string type.

or better

or bes



Thanks all. I guess I was overzealous.