1. Syntax & xcontrols line count
- Posted by Tony Steward <tony.steward at gmail.com> Apr 03, 2005
- 430 views
------=_Part_1781_4226022.1112516653940 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Disposition: inline Hello all, I am using Don Coles XControls and would like to kow how to get the line number the cursor is on in the rich edit control. His rich edit control has been customized so this might make thing a little more difficult. I have used this: LineNum = sendMessage(SyntaxID,EM_LINEFROMCHAR,-1,0) + 1 This tends to lag behind and often be one line out. I hope there is a better way! -- Regards Tony Steward www.locksdownunder.com <http://www.locksdownunder.com> ------=_Part_1781_4226022.1112516653940 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Disposition: inline Hello all,<br> I am using Don Coles XControls and would like to kow how to get the line number the cursor is on in the rich edit control.<br> <br> His rich edit control has been customized so this might make thing a little more difficult.<br> <br> I have used this:<br> LineNum = sendMessage(SyntaxID,EM_LINEFROMCHAR,-1,0) + 1<br> <br> This tends to lag behind and often be one line out.<br> I hope there is a better way!<br><br>-- <br>Regards<br>Tony Steward<br><a href="http://www.locksdownunder.com">www.locksdownunder.com</a><br><br> ------=_Part_1781_4226022.1112516653940--
2. Re: Syntax & xcontrols line count
- Posted by Tone Škoda <tskoda at email.si> Apr 03, 2005
- 414 views
Tony Steward wrote: > I have used this: > LineNum = sendMessage(SyntaxID,EM_LINEFROMCHAR,-1,0) + 1 > > This tends to lag behind and often be one line out. > I hope there is a better way! you have to read file in "r" mode, not "rb" mode. if that dooesnt work convert newlines to some other format (there are these newlines: {13,10}, {10, 13}, 10 or 13 i think)
3. Re: Syntax & xcontrols line count
- Posted by Tony Steward <tony.steward at gmail.com> Apr 03, 2005
- 424 views
------=_Part_1814_2339560.1112526184017 Content-Type: text/plain; charset=ISO-8859-2