help needed for using StringToUpper

To add comments, please log in or register
Qæs
170
Qæs  

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.

Naguisa Unada
416
Naguisa Unada  

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

extern string MyPair = "eurusd";

bool xyz = StringToUpper(MyPair);
Qæs
170
Qæs  
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.

Naguisa Unada
416
Naguisa Unada  
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". 

Qæs
170
Qæs  
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.

To add comments, please log in or register