Henry Vermaak wrote:
> On 16/04/2008, Jon Foster <[EMAIL PROTECTED]> wrote:
>   
>> I'm trying to determine where the which line in a TMemo the cursor is
>>  on. [...]
> err, this is probably a hack, but you can use pos(lineending,
> memo.lines.text) in a loop to count how many newlines before you get
> to memo.selstart.  then rposex(lineending, memo.lines.text,
> memo.selstart) to find how far you are in the line you are.  works in
> gtk2, at least (can send code if i don't make sense :).
>   
Make sense. It would be quicker to write a loop to scan the string 
counting lineendings rather than using all those "pos" calls. Eliminates 
the overhead of having to make those calls. Since there doesn't appear 
to be any known built in solution for this I think I'll do just that.

THX - Jon

-- 
Jon Foster
JF Possibilities, Inc.
[EMAIL PROTECTED]
541-410-2760
Making computers work for you!

_______________________________________________
Lazarus mailing list
[email protected]
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to