home *** CD-ROM | disk | FTP | other *** search
- unit Unit1;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls;
-
- type
- TForm1 = class(TForm)
- Button1: TButton;
- procedure Button1Click(Sender: TObject);
- private
- public
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- uses MiTeC_Journal;
-
- var
- Journal: TJournal;
-
- {$R *.dfm}
-
- procedure TForm1.Button1Click(Sender: TObject);
- var
- i: Integer;
- j: Double;
- begin
- Journal.WriteEvent('First Level',elBegin);
- Journal.WriteEventFmt('Called from %s',[TComponent(Sender).Name],elData);
- Journal.WriteEvent('First Level',elEnd);
- Journal.WriteEvent('Some action',elAction);
- Journal.WriteEvent('Some info',elInformation);
- Journal.WriteEvent('Another First Level',elBegin);
- for i:=0 to 100000000 do
- j:=Sqrt(i);
- Journal.WriteEventFmt('Sqrt(%d)=%f',[i,j],elData);
- Journal.WriteEvent('Some error',elError);
- Journal.WriteEvent('Second Level',elBegin);
- Journal.WriteEvent('Some warning',elWarning);
- Journal.WriteEvent('Second Level',elEnd);
- Journal.WriteEvent('First Level',elEnd);
- end;
-
- initialization
- Journal:=TJournal.Create(ExtractFilePath(Application.ExeName),
- ChangeFileExt(ExtractFilename(Application.ExeName),''),
- False,False,False);
- finalization
- Journal.Free;
- end.
-