15. Januar 2019 14:30
WriteNoteToFile(Filename : Text;MessageText : Text;WriteTimestamp : Boolean)
CLEAR(OutFile);
CLEAR(OStream);
OutFile.WRITEMODE := TRUE;
CRLF := ' ';
CRLF[1] := 13;
CRLF[2] := 10;
IF EXISTS(Filename) THEN BEGIN
OutFile.OPEN(Filename, TEXTENCODING::Windows);
OutFile.SEEK(OutFile.LEN);
END ELSE
OutFile.CREATE(Filename, TEXTENCODING::Windows);
OutFile.CREATEOUTSTREAM(OStream);
IF WriteTimestamp THEN
OStream.WRITETEXT(STRSUBSTNO('%1 %2 %3', TODAY, TIME, MessageText))
ELSE
OStream.WRITETEXT(MessageText);
OStream.WRITETEXT(CRLF);
OutFile.CLOSE;
OutFile: File
CRLF: Text[2]
OStream: OutStream
15. Januar 2019 14:46
OutFile.TEXTMODE := TRUE
17. Januar 2019 09:46
WriteNoteToFile3(Filename : Text;MessageText : Text;WriteTimestamp : Boolean)
CLEAR(OutFile);
OutFile.WRITEMODE := TRUE;
OutFile.TEXTMODE := TRUE;
CRLF := ' ';
CRLF[1] := 13;
CRLF[2] := 10;
IF EXISTS(Filename) THEN BEGIN
OutFile.OPEN(Filename, TEXTENCODING::Windows);
OutFile.SEEK(OutFile.LEN);
END ELSE
OutFile.CREATE(Filename, TEXTENCODING::Windows);
IF WriteTimestamp THEN
OutFile.WRITE(STRSUBSTNO('%1 %2 %3', TODAY, TIME, MessageText))
ELSE
OutFile.WRITE(MessageText);
OutFile.WRITE(CRLF);
OutFile.CLOSE;
WriteNoteToFile3('c:\temp\TestFile_direkt.txt', 'Testnachricht4', TRUE);
17.01.19 08:28:26 Testnachricht4
17.01.19 08:28:35 Testnachricht4
17.01.19 08:28:42 Testnachricht4