home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 November
/
Chip_2002-11_cd1.bin
/
zkuste
/
delphi
/
unity
/
d56
/
MJOURNAL.ZIP
/
Demo
/
Unit1.pas
< prev
Wrap
Pascal/Delphi Source File
|
2002-08-29
|
1KB
|
57 lines
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.