Download MetaTrader 5

CryptTool mQL4 converted MQL5

To add comments, please log in or register
Leny Boulard
422
Leny Boulard 2013.03.11 10:43 

i have translate this good tool for coding string script for obsfucation.

 but i don t why i have this error in the log of editor at the compilation "implicit conversion from 'number' to 'string' CrypTool_Mt5.mq5" ?

 and the script converse good running !

#property  script_show_inputs
input string prefix = "char";
input string text   = "input your text and go to Log.";
string rez        = ""; // here we will assemble the result

void OnStart()
  {
  // enter the original text to see what this string is
  rez = "/* " + text + " */ \n"; 
    for (int i = 0; i < StringLen(text); i++) 
  rez = rez + prefix + "[" + (StringGetCharacter(text, i)) + "]+";
  // cut the last '+' character and print string to the log
  Print(StringSubstr(rez, 0, StringLen(rez)-1));

  }
Simon Gniadkowski
Moderator
18002
Simon Gniadkowski 2013.03.11 11:20  
Leny:

i have translate this good tool for coding string script for obsfucation.

 but i don t why i have this error in the log of editor at the compilation "implicit conversion from 'number' to 'string' CrypTool_Mt5.mq5" ?

 and the script converse good running !


Please use the   SRC  button to post code . . . 

 

Use SRC 

Simon Gniadkowski
Moderator
18002
Simon Gniadkowski 2013.03.11 11:24  
Leny:

i have translate this good tool for coding string script for obsfucation.

 but i don t why i have this error in the log of editor at the compilation "implicit conversion from 'number' to 'string' CrypTool_Mt5.mq5" ?

I think it is because  StringGetCharacter  returns a unsigned short  (number)  and it is converted to text to form part of  rez
Simon Gniadkowski
Moderator
18002
Simon Gniadkowski 2013.03.11 11:47  
Leny:
sorry , thanks for modification.

No worries,  if you do an explicit cast it gets rid of the warning . . .

  rez = rez + prefix + "[" + (string)StringGetCharacter(text, i) + "]+";
Leny Boulard
422
Leny Boulard 2013.03.11 13:05  
RaptorUK:

No worries,  if you do an explicit cast it gets rid of the warning . . .

Thanks. 

To add comments, please log in or register