1 unit Debug;
2 
3 interface
4 
5 uses
6   Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
7 
8 type
9   TDebugForm = class(TForm)
10     DebugMemo: TMemo;
11   end;
12 
13 var
14   DebugForm: TDebugForm;
15 
16 procedure DebugLine(const S: String);
17 
18 implementation
19 
20 {$R *.DFM}
21 
22 const
23   MaxString = 1024;
24 
25 procedure DebugLine(const S: String);
26 begin
27   if DebugForm = nil then Application.CreateForm(TDebugForm, DebugForm);
28   DebugForm.Show;
29   With DebugForm.DebugMemo.Lines do begin
30     if Count >= MaxString then Delete(0);
31     Add(S);
32   end;
33 end;
34 
35 initialization
36   DebugForm:=nil;
37 end.
38