unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, PaxCompiler, StdCtrls, PaxCompilerExplorer, PaxProgram;

type
  TForm3 = class(TForm)
    Button1: TButton;
    PaxCompiler1: TPaxCompiler;
    PaxPascalLanguage1: TPaxPascalLanguage;
    PaxCompilerExplorer1: TPaxCompilerExplorer;
    PaxProgram1: TPaxProgram;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form3: TForm3;

implementation

{$R *.dfm}

procedure TForm3.Button1Click(Sender: TObject);
var
  L: TStringList;
begin
  L := TStringList.Create;
  try
  PaxCompiler1.Reset;
  PaxCompiler1.RegisterLanguage(PaxPascalLanguage1);
  PaxCompiler1.AddModule('1', 'Pascal');
  PaxCompiler1.AddCodeFromFile('1', 'script2.txt');
  if PaxCompiler1.CodeCompletion('1', 5, 9, Memo1.Lines) then
  begin
    //ok
  end
  else
    ShowMessage(PaxCompiler1.ErrorMessage[0]);
  finally
    L.Free;
  end;
end;

end.
