Hi Eamon,
Hack this code from a very old project:
> I need to figure out which line of A TDBMemo I'm on so I can insert a new
> line at that point is there something obvious I am missing here?
// gets cno as well, not the cleanest calling interface <g>
function TEditForm.getLineNo(var cno: Integer): Integer;
var pos: Longint;
begin
pos := Memo1.SelStart+Memo1.SelLength;
Result
:=sendMessage(Memo1.Handle,EM_LINEFROMCHAR,pos,0);
cno := pos-
sendMessage(Memo1.Handle,EM_LINEINDEX,Result,0);
end;
cheers,
peter
============================================
Peter Hyde, WebCentre Ltd & SPIS Ltd, Christchurch, New Zealand
* Web automation for online periodicals: http://TurboPress.com
* TurboNote: http://TurboPress.com/tbnote.htm
-- small, FREE and very handy
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz