title: how can delphi 'string' literals be more than 255?
body: <p>im working on <strong>delphi 7</strong> and i was working on a strings, i came across this</p>
  
  <blockquote>
    <p>For a string of default length, that is, declared simply as string, max size is always 255. A ShortString is never allowed to grow to more than 255 characters.</p>
  </blockquote>
  
  <p>on <a href="http://www.codexterity.com/delphistrings.htm" rel="noreferrer">delphi strings</a></p>
  
  <p>once i had to do something like this in my delphi code (that was for a really big query)</p>
  
  <pre><code>  var
      sMyStringOF256characters : string;
      ilength : integer;
      begin
         sMyStringOF256characters:='ThisStringisofLength256,ThisStringisofLength256,.....'
         //length of sMyStringOF256characters is 256
      end;
  </code></pre>
  
  <p>i get this <strong>error</strong> </p>
  
  <blockquote>
    <p>[Error] u_home.pas(38): String literals may have at most 255 elements.</p>
  </blockquote>
  
  <p>but when i try this</p>
  
  <pre><code>    var
        iCounter              : integer;
        myExtremlyLongString  : string;
     begin
        myExtremlyLongString:='';
        Label1.Caption:='';
        for iCounter:=0 to 2500 do
           begin
              myExtremlyLongString:=myExtremlyLongString+inttostr(iCounter);
              Label1.Caption:=myExtremlyLongString;
           end;
           Label2.Caption:=inttostr(length(myExtremlyLongString));
     end; 
  </code></pre>
  
  <p>and the result is </p>
  
  <p><img src="https://i.stack.imgur.com/Ea2OV.jpg" alt="enter image description here"></p>
  
  <p>As you can see the length of <strong>myExtremlyLongString</strong> is <strong>8894</strong> characters.</p>
  
  <p>why did not delphi give any error saying the length is beyond 255 for <strong>myExtremlyLongString</strong>? </p>
  
  <p><strong>EDIT</strong>
  i used</p>
  
  <pre><code>SetLength(sMyStringOF256characters,300);
  </code></pre>
  
  <p>but it doesnt work.</p>