help needed for using StringToUpper

 

With property strict

extern string MyPair = "eurusd";

string xyz = StringToUpper(MyPair); // gives warning: implicit conversion from 'number' to 'string'

But in some function body...

void DoBreakEven(int BP, int BE){
StringToUpper(MyPair);              // no warning
// ...
}

and

string SetCase()
{
   StringToUpper(thisPair);
   return(thisPair);
}
// no warning

I want to do it the right way for once (if possible) so i could be able to use it in any function (one or more, both custom and built-in) in same file. Please guide.

 

"StringToUpper" returns a bool value, ie in case of success returns true, otherwise, false.

extern string MyPair = "eurusd";

bool xyz = StringToUpper(MyPair);
 
Naguisa Unada:

"StringToUpper" returns a bool value, ie in case of success returns true, otherwise, false.

Yes I checked that, you are right BUT this is not the answer to my question. Please guide me for that too.

 
Qæs:

Yes I checked that, you are right BUT this is not the answer to my question. Please guide me for that too.

What? This is the answer to your question.

It gave you a warning because you were trying to receive a bool value with a string variable "xyz".

if "StringToUpper" returns true, it means that the string "eurusd" was changed to "EURUSD".

ie "MyPair" have the string "EURUSD". 

 
Naguisa Unada:

if "StringToUpper" returns true, it means that the string "eurusd" was changed to "EURUSD".

ie "MyPair" have the string "EURUSD". 

I got it, thank you.

Reason: