A strange error - Comment

 

Hello freinds,

As I enter the following lines:

Comment ("\n"," 1 PROFIT in USD = ", NUMP1," PROFIT LOCKED = ", LP1,
"\n"," 2 PROFIT in USD = ", NUMP2," PROFIT LOCKED = ", LP2,
"\n"," 3 PROFIT in USD = ", NUMP3," PROFIT LOCKED = ", LP3,
"\n"," 4 PROFIT in USD = ", NUMP4," PROFIT LOCKED = ", LP4,
"\n"," 5 PROFIT in USD = ", NUMP5," PROFIT LOCKED = ", LP5,
"\n"," 6 PROFIT in USD = ", NUMP6," PROFIT LOCKED = ", LP6,
"\n"," 7 PROFIT in USD = ", NUMP7," PROFIT LOCKED = ", LP7,
"\n"," 8 PROFIT in USD = ", NUMP8," PROFIT LOCKED = ", LP8,
"\n"," 9 PROFIT in USD = ", NUMP9," PROFIT LOCKED = ", LP9,
"\n"," 10 PROFIT in USD = ", NUMP10," PROFIT LOCKED = ", LP10,
"\n"," 11 PROFIT in USD = ", NUMP11," PROFIT LOCKED = ", LP11,
"\n"," 12 PROFIT in USD = ", NUMP12," PROFIT LOCKED = ", LP12,
"\n"," 13 PROFIT in USD = ", NUMP13," PROFIT LOCKED = ", LP13,
"\n"," 14 PROFIT in USD = ", NUMP14," PROFIT LOCKED = ", LP14,"\n");

I get an error: ')' Worng parameters count.

Can somebody help me..?

Thanks

 
crossy:

As I enter the following lines:

Comment ("\n"," 1 PROFIT in USD = ", NUMP1," PROFIT LOCKED = ", LP1,
"\n"," 2 PROFIT in USD = ", NUMP2," PROFIT LOCKED = ", LP2,
"\n"," 3 PROFIT in USD = ", NUMP3," PROFIT LOCKED = ", LP3,
"\n"," 4 PROFIT in USD = ", NUMP4," PROFIT LOCKED = ", LP4,
"\n"," 5 PROFIT in USD = ", NUMP5," PROFIT LOCKED = ", LP5,
"\n"," 6 PROFIT in USD = ", NUMP6," PROFIT LOCKED = ", LP6,
"\n"," 7 PROFIT in USD = ", NUMP7," PROFIT LOCKED = ", LP7,
"\n"," 8 PROFIT in USD = ", NUMP8," PROFIT LOCKED = ", LP8,
"\n"," 9 PROFIT in USD = ", NUMP9," PROFIT LOCKED = ", LP9,
"\n"," 10 PROFIT in USD = ", NUMP10," PROFIT LOCKED = ", LP10,
"\n"," 11 PROFIT in USD = ", NUMP11," PROFIT LOCKED = ", LP11,
"\n"," 12 PROFIT in USD = ", NUMP12," PROFIT LOCKED = ", LP12,
"\n"," 13 PROFIT in USD = ", NUMP13," PROFIT LOCKED = ", LP13,
"\n"," 14 PROFIT in USD = ", NUMP14," PROFIT LOCKED = ", LP14,"\n");

I get an error: ')' Worng parameters count.

You have more than the max 64 parameters... It's specifically mentioned in the docs -> https://docs.mql4.com/common/Comment.

 
gordon:

You have more than the max 64 parameters... It's specifically mentioned in the docs -> https://docs.mql4.com/common/Comment.


Thanks.

Is "/n" is considered as parameter, too?

eventhought, I tried a shorter comment (I deleted 5 lines) and I gor the same error..

How can I overcome this limit? - a symple way..?

 
crossy:

How can I overcome this limit? - a symple way..?

Concatenate the string before passing it to Comment(). Either use StringConcatenate() or the addition operation '+'. Note that StringConcatenate() is limited to 64 parameters as well, so use it more than once...
 
gordon:
Concatenate the string before passing it to Comment(). Either use StringConcatenate() or the addition operation '+'. Note that StringConcatenate() is limited to 64 parameters as well, so use it more than once...


Thanks gordon.

I did it and it is O.K.

I want to wide this discusion:

At COMMENT() it is not allowed to enter arrays. If I use string text1 = StringConcatenate(kk[5]), and there I put an array, Is it allowed to enter text1 to a COMMENT line?

 
Comment ("\n"," 1 PROFIT in USD = ", NUMP1," PROFIT LOCKED = ", LP1,
"\n"," 2 PROFIT in USD = ", NUMP2," PROFIT LOCKED = ", LP2,...
  1. Comment ("\n 1 PROFIT in USD = ", NUMP1," PROFIT LOCKED = ", LP1,
    "\n 2 PROFIT in USD = ", NUMP2," PROFIT LOCKED = ", LP2,...
    

  2. Comment ("\n 1 PROFIT in USD = "+DoubleToStr(NUMP1,Digits),
           " PROFIT LOCKED = "+DoubleToStr(LP1,Digits),
    "\n 2 PROFIT in USD = "+DoubleToStr(NUMP2,Digits)...

  3. string line1="1 PROFIT in USD = "+DoubleToStr(NUMP1,Digits)+
       " PROFIT LOCKED = "+DoubleToStr(LP1,Digits);
        ...
    Comment (line1,line2...)
Reason: