MPL Documentation

TEXT

is a type for working with text file I/O on any platform. It can be used to read blocks of text, terminating on CR, LF, CRLF or LFCR. 
var
   TFH:File;

Procedure AddToLog(S:String);
Begin
   WriteLnText(TFH, FormatTimestamp('yyyy-mm-dd hh:nn',Timestamp) #32 S);
End;

Begin
   AssignText(TFH,'testfile.log');
   If FileExists('testfile.log') then Append(TFH)
   Else Reset(TFH);
   AddToLog('This is an example of making a simple log file routine.');
   CloseText(TFH);
End.
Source: Reserved Words
See Also:
file, SYSTEM assigntext, SYSTEM append, SYSTEM reset, SYSTEM closetext.