Op 19-07-13 16:21, Malcolm Poole schreef:
...
==================================
procedure TForm1.UpButtonClick ( Sender: TObject ) ;
var
newcaretPos: Integer;
x: Integer;
begin
newcaretPos := 0;
writeln(Memo1.CaretPos.Y, #32, Memo1.CaretPos.X);
for x := 0 to Memo1.CaretPos.Y-2 do
newcaretPos := newcaretPos + Length(Memo1.Lines[x]) +
Length(LineEnding);
if Length(Memo1.Lines[Memo1.CaretPos.Y-1]) < Memo1.CaretPos.X
then newcaretPos := newcaretPos +
Length(Memo1.Lines[Memo1.CaretPos.Y-1]) + 1
else newcaretPos := newcaretpos + Memo1.CaretPos.X;
Memo1.SelStart := newcaretPos;
Memo1.SetFocus;
end;
Hi,
Thanks,
but you're too nice, leave me some homework ! ;-)
Koenraad Lelong
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus