Jump to content
Sign in to follow this  

Function to Read Lines Of RichEdit Not Working

Recommended Posts


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 ""
        Return _GUICtrlRichEditGetText($h_RichEdit, $start, $end)

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?



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

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.