unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm2 = class(TForm)
    Panel1: TPanel;
    ListBox1: TListBox;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    function ShowModal: Integer; override;
  end;

var
  Form2: TForm2;

implementation

uses Unit1;

{$R *.dfm}

function TForm2.ShowModal: Integer;
var
  I: Integer;
  S: String;
  ch: Char;
begin
  ListBox1.Items.Clear;
  for I:=0 to Form1.Memo1.Lines.Count - 1 do
  begin
    if Form1.PaxCompilerExplorer1.IsExecutableLine('1', I) then
      ch := '*'
    else
      ch := ' ';
    S := Format('%3d    ', [I]) + ch + '     ' + Form1.Memo1.Lines[I];
    ListBox1.Items.Add(S);
  end;

  result := inherited ShowModal;
end;

procedure TForm2.Button1Click(Sender: TObject);
var
  I: Integer;
begin
  I := ListBox1.ItemIndex;
  if Form1.PaxCompilerExplorer1.IsExecutableLine('1', I) then
    Form1.PaxCompilerDebugger1.AddTempBreakpoint('1', I)
  else
  begin
    ShowMessage(IntToStr(I) + ' is not executable line!');
    ModalResult := mrCancel;
  end;
end;

end.
