Nee, dit logfile.

, code blijkt één manier te redden. Dat is wat dingen op in je aanvraag in een log, hier zijn twee bestanden. En nu, het project dossier en een eenheid van het werk dat is {Unit1.pas}...,,,,,,,, - de eenheid zijn,,,,, {$DEFINE DEBUG}, toepassingen, DEBUG}, {$IFDEF uLog, {$ENDIF},, ramen, berichten, SysUtils, klassen, grafische, controles, vormen, Dialogs StdCtrls;,,,,,,, TForm1 = type, klasse (tform), Button1: TButton;,,, de procedure Button1Click (Sender: TObject);,, privé, {'} bevat. ",,, openbare verklaringen {},,,,,,,, Form1: var, TForm1;,,,,, {$R uitvoering, *.DFM},,, de procedure TForm1.Button1Click (Sender: TObject);,,, Bar: var, de gehele;,,",, BAR: = 100;,,, {$IFDEF DEBUG}, log (formaat ('Button1.Click; BAR - =%d', [Bar]);,, {$ENDIF} einde;,,,,,.,,,,,, //--------------------------------------------------------------------, {uLog.pas}, eenheid uLog;,,,,, een procedure log (- -);,,, uitvoering van De begroting,,,,,, de toepassingen, ramen, SysUtils;,,,, LogFile: var, TextFile;,, LogCriticalSection: TRtlCriticalSection;,,, - (en); - procedure), var, SystemTime: TSystemTime;,,,,,, ik FileTime: TFileTime;,,,, GetSystemTime (systemtime); SystemTimeToFileTime (systemtime filetime);,,,,, EnterCriticalSection (LogCriticalSection); WriteLn (LogFile, formaat (%%.8x%.8x s,,, [FormatDateTime ('yy.mm.dd hh.mm.ss', nu FileTime.dwHighDateTime FileTime.dwL,,,,owDateTime, S]));,, LeaveCriticalSection(LogCriticalSection);,, end;,,, procedure Startup;,, var,, FileName: String;,, begin,, InitializeCriticalSection(LogCriticalSection);,, FileName := Format('Log file for %s at %s.txt',,, [ParamStr(0), DateTimeToStr(Now)]);,, while Pos(':', FileName) > 0 do FileName[Pos(':', FileName)] := '.';,, while Pos('/', FileName) > 0 do FileName[Pos('/', FileName)] := '-';,, while Pos('\\', FileName) > 0 do FileName[Pos('\\', FileName)] := '.';,, AssignFile(LogFile, FileName);,, Rewrite(LogFile);,, end;,,, procedure Shutdown;,, begin,, CloseFile(LogFile);,, DeleteCriticalSection(LogCriticalSection);,, end;,,, initialization,, Startup;,, finalization,, Shutdown;,, end.,



Previous:
Next Page: