DEFINITION MODULE TextFile;

FROM SYSTEM IMPORT ADDRESS;
IMPORT Objects;

CONST MaxTextLen=1000;

TYPE
 TextRecPtr = POINTER TO TextRec;
 TextRec = RECORD
            next,prev:TextRecPtr;
            len:CARDINAL;
            text:ARRAY[0..MaxTextLen] OF CHAR;
           END;

 TText = CLASS(Objects.TObject)
           root,last:TextRecPtr;
           lines,maxlen:LONGINT;
           CONSTRUCTOR Init;
           PROCEDURE GetLine(l:LONGINT):ADDRESS;
           PROCEDURE AddLine(txt:ARRAY OF CHAR);
           PROCEDURE InsertLine(p:TextRecPtr;txt:ARRAY OF CHAR);
           PROCEDURE DeleteLine(p:TextRecPtr);
           PROCEDURE ReadText(name:ARRAY OF CHAR):BOOLEAN;
           PROCEDURE Free;
         END;


END TextFile.
