title: OleVariant and String assignments in Delphi 5
body: <p>I have a Delphi 5 legacy application and there's a part in which a "string" value is been assigned to an "OleVariant" variable. Something like this:</p>
  
  <pre><code>var
     X: OleVariant;
     S: string;
  Begin
     S:= ‘This string should contain 200 characters as per design’;
     X:= S; 
  End;
  </code></pre>
  
  <p>If the length of “S” is greater than 128, then the value of “X” gets truncated and it only holds a maximum of 128 characters.</p>
  
  <p>Is there a way to overcome this?</p>
  
  <p>I believe there is a way, because if I create my own demo application from scratch (in the same PC, with the same Delphi 5), it allows me to pass longer string values and no truncating is done. </p>
  
  <p>Maybe it is something about the project settings or compiler directives. I have played around with this idea, but I have no workaround yet.</p>
  
  <p>Any help is appreciated. Thanks.</p>
  
  <p>Demo:</p>
  
  <pre><code>procedure TForm1.Button1Click(Sender: TObject);
  var
    X: OleVariant;
    S: string;
  begin
    //in the Edit I pass a string of 240 chars, let's say;
    S:= Edit1.Text;
    X:= S;
    ShowMessage(IntToStr(Length(X)) + ' : ' + IntToStr(Length(S)));
    //this showmessage shows "128 : 240"
  end;
  </code></pre>