gamingmouse Posted November 5, 2007 Posted November 5, 2007 I need to read a certain number of lines (rather than selected text, or text between known character indeces) of a RichEdit control. Here is my attempt at a function to do so (the below uses existing function from Gary Frost's script):Func _GuiCtrlRichEditGetLines($h_RichEdit, $lineStart, $lineEnd) $start = _GUICtrlRichEditLineIndex($h_RichEdit, $lineStart) $end = _GUICtrlRichEditLineIndex($h_RichEdit, $lineEnd) + _GUICtrlRichEditLineLength($h_RichEdit, $lineEnd) -1 If $start >= $end Then Return "" Else Return _GUICtrlRichEditGetText($h_RichEdit, $start, $end) EndIf EndFuncIf the text box has many lines, and I read a small portion of them, the above kind of works. If I read 5 lines, it will return anywhere from 5-7 lines. However, if I want to read ALL lines (0 to TotalLines-1), it will not work. When I attempt this sometimes it returns nothing, sometimes a single word or so.Can anyone correct the above function so that it does what I am intending?Thanksgm
gamingmouse Posted November 5, 2007 Author Posted November 5, 2007 bump.... sorry, this forum moves quick.
GaryFrost Posted November 6, 2007 Posted November 6, 2007 Look at the Beta _GUICtrlEdit_xxxx functions, they should work with the RichEdit control also. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now