title: Pascal - Whats causing this runtime error(216)?
body: <p>Whenever I run <code>SafteyDepositBox.SetNewCode</code> I get a <code>runtime error 216</code>. Any idea whats causing this?
  This is the error :</p>
  
  <blockquote>
    <p>Runtime error 216 at $00401EFC<br>   $00401EFC<br>   $0040153D<br><br>
    $00401596<br>   $00406E31<br></p>
  </blockquote>
  
  <pre><code>program Boxy;
  {$MODE OBJFPC}
  {$M+}
  type
   SDB = class
    private
     State : string;
     Code : string;
    public
     Constructor Create();
     procedure SetNewCode(newcode:string);
     function Valid(s:string):boolean;
  end;
  
  constructor SDB.Create();
  begin
   State := 'Open-NoCode';
   Code := ''; 
  end;
  
  procedure SDB.SetNewCode(newcode:string);
  begin
   Code := newcode;
   writeln(Code);
  end;
  
  function SDB.Valid(s:string):boolean;
  var
   IsValid : boolean;
  begin 
   If (length(s) = 4) then
    IsValid := true
   else
    IsValid := false;
   Valid := IsValid;
  end;
  
  var 
   SafetyDepositBox : SDB;
  begin
   SafetyDepositBox.Create();
   SafetyDepositBox.SetNewCode('r2d2');// runtime error 216 here
  end.
  </code></pre>