title: How to find out char code for a character of an Ansistring
body: <p>In older versions of Delphi, like D7, you could do like <code>ord(s[i])</code> where s was a string, but trying this with an AnsiString results in an exception (access violation).</p>
  
  <p>P.S. I was w/delphi 7 for a long time.</p>
  
  <p>Here are the steps to reproduce the error:
  Create a new project and through a memo on the form (let it be memo1) than add the following code to the form create event handler:</p>
  
  <pre><code>procedure TForm1.FormCreate(Sender: TObject);
  var u: ansistring;
  begin
      u := 'stringtest';
      memo1.Lines.Add(inttostr(ord(u[2])));
  end;
  </code></pre>
  
  <p>For me this code produces an AV.</p>