There are many ways to do this, and I'm not sure how you are going to process newlines. However, all routes lead to TMemo.Lines , which is an instance of TStrings that completes the Windows messages needed to interact with the basic Windows editing control.
For example, these procedures should get started.
procedure AddNewLine(Memo: TMemo); begin Memo.Lines.Add(''); end; procedure AddCharacter(Memo: TMemo; const C: Char); var Lines: TStrings; begin Lines := Memo.Lines; if Lines.Count=0 then AddNewLine(Memo); Lines[Lines.Count-1] := Lines[Lines.Count-1]+C; end;
source share