Sign in to follow this  
Followers 0
gamingmouse

Function to Read Lines Of RichEdit Not Working

3 posts in this topic

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
EndFunc

If 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?

Thanks

gm

Share this post


Link to post
Share on other sites



bump.... sorry, this forum moves quick.

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0