> Memo1.Text := Memo1.Text + Temptext;
> Memo1.SelStart := Length(Memo1.Text);
That is very inefficient. You are copying the entire TMemo contents to a
temporary String, then replacing the entire TMemo contents with a new
string, then copying the entire contents back to another temporary String to
query its length. The more content the TMemo has, the longer those
operations will take, and the more memory they will consume.
Use the SelText property instead when appending new text, and use the
GetTextLen() method to retreive the current length, ie:
Code:
Memo1.SelStart := Memo1.GetTextLen;
Memo1.SelLength := 0;
Memo1.SelText := Temptext;
Memo1.SelStart := Memo1.GetTextLen;
SendMessage(Memo1.Handle, EM_SCROLLCARET, 0, 0);
Gambit