procedure WriteLog(Msg : string);
var
f: TextFile;
ASBName, FileName : String;
begin
FileName := FormatDateTime('yyyymmdd', Now);
ASBName := GetModuleName(HInstance);
FileName := ExtractFilePath(ASBName)+FileName;
//ASBName := ExtractFileName(ASBName);
FileName := FileName +'_Log.txt';
Try
if not DirectoryExists(ExtractFilePath(FileName)) then
ForceDirectories(ExtractFilePath(FileName));
AssignFile(f, FileName);
if FileExists(FileName) then Append(f) else ReWrite(f);
if Msg = '' then
Msg := #13+'System DateTime: '+FormatDateTime('dd/mm/yyyy hh:mm:ss:zzz AM/PM', Now);
Writeln(f, Msg);
CloseFile(f);
Except
End;
end;
var
f: TextFile;
ASBName, FileName : String;
begin
FileName := FormatDateTime('yyyymmdd', Now);
ASBName := GetModuleName(HInstance);
FileName := ExtractFilePath(ASBName)+FileName;
//ASBName := ExtractFileName(ASBName);
FileName := FileName +'_Log.txt';
Try
if not DirectoryExists(ExtractFilePath(FileName)) then
ForceDirectories(ExtractFilePath(FileName));
AssignFile(f, FileName);
if FileExists(FileName) then Append(f) else ReWrite(f);
if Msg = '' then
Msg := #13+'System DateTime: '+FormatDateTime('dd/mm/yyyy hh:mm:ss:zzz AM/PM', Now);
Writeln(f, Msg);
CloseFile(f);
Except
End;
end;
No comments:
Post a Comment