title: Delphi, Copy string to Byte array
body: <p>what i have works, but im looking if there is a faster way to copy a string into a pByteArray</p>
  
  <p>from sysutils</p>
  
  <pre><code>  PByteArray = ^TByteArray;
    TByteArray = array[0..32767] of Byte;
  </code></pre>
  
  <p>assume <strong>a</strong> and <strong>s</strong> are setup correctly</p>
  
  <pre><code> a:   pByteArray;
   s:   string;
  </code></pre>
  
  <p>is there a fast way to do this, ie something like copy</p>
  
  <pre><code>  for i := 1 TO Length(s) - 1 do
     a^[i] := Ord(s[i]);
  </code></pre>
  
  <p>delphi 7</p>