What is the Max length of a string?

 

Hi; I have the following code below to automatically increase the string instead of having to manually enter each character.

    // Display Divider
     ObjectCreate ("Divider", OBJ_LABEL,0,0,0); 
     ObjectSet    ("Divider", OBJPROP_CORNER, WhichCorner);  // defined earlier
     ObjectSet    ("Divider", OBJPROP_YDISTANCE, 106); 

     string divider="=";
     for(int i = 0;i<37;i++) {   
       divider=divider+"=";          
     }   

     ObjectSet    ("Divider", OBJPROP_XDISTANCE, 3);                        
     ObjectSetText("Divider", divider, fontSize-1, Font,clrGray);  // fontSize & Font defined earlier

The code works as intended.  However I would prefer a hyphen instead of an equal sign for the divider.  The problem is that when I replace the equal sign with a hyphen, the output value of the string shrinks remarkably despite using the same counter.  And after setting the counter to 200, anything over that number seems to be ignored when I use the hyphen character.   Am I correct in my observation?


Thanks in advance for your responses.


Lode

 
Lode Loyens:

Hi; I have the following code below to automatically increase the string instead of having to manually enter each character.

The code works as intended.  However I would prefer a hyphen instead of an equal sign for the divider.  The problem is that when I replace the equal sign with a hyphen, the output value of the string shrinks remarkably despite using the same counter.  And after setting the counter to 200, anything over that number seems to be ignored when I use the hyphen character.   Am I correct in my observation?


Thanks in advance for your responses.


Lode

You are trying to fill the span of the entire screen with the divider ?

 
Lorentzos Roussos #:

You are trying to fill the span of the entire screen with the divider ?

Hi thanks for responding.  No!   I want to draw a horizontal divider line between two Objects that looks like this:

-----------------------------------------------------------------------

The length you see of the line here, is about right but for reasons I can't figure out, my little code doesn't seem to go beyond 150 characters when

using a hyphen (-).  Yet when I use this symbol "=" (no quotes), it works.

I searched online but can't find and answer why this is so.


Have a great day still.  Tnx

 
Label Object Text Truncated
Label Object Text Truncated
  • 2008.02.18
  • Forex Trader
  • www.mql5.com
Hi there, I am creating some label objects on my charts but the text of the label appears to be truncated by MT to 63 characters...
 
Lode Loyens: The problem is that when I replace the equal sign with a hyphen, the output value of the string shrinks remarkably despite using the same counter.
Correct. That is because you are using variable width characters. Change your font to a fixed width, such as Courier.
 

Mr. Roeder;

You did it again!  Thank you.  I wish I had 10% of your knowledge.


Lode