anchor.diff: -{$mode delphi}{$i xpc.inc}
  +{$mode delphiunicode}{$i xpc.inc}
   program impforth;
   uses xpc, uapp, ukm, uimpforth, ui, cw, kvm,cli;
   
  
positive.code:   end;
  
  procedure TForthApp.keys(km : ukm.TKeyMap);
    var ch : char;
    begin
      for ch := #0 to #225 do km.crt[ ch ] := DelegateKey;
      km.cmd[ ^C ] := quit;
    end;
  
  procedure TForthApp.OnCmdAccept( s : string );
    begin
      imp.Send(s); prompt;
    end;
  
  //  !! copied directly from TEditor.DelegateKey :/
  procedure TForthApp.DelegateKey( ext : boolean; ch : char );
    begin
      if ext then cmd.handlestripped(ch)
      else cmd.handle(ch);
    end;
  
  procedure TForthApp.prompt;
    begin
  
negative.code:     if not imp.NeedsInput then imp.EvalNextToken;
    end;
  
  begin
    uapp.Run(TForthApp);
  end.
  