mike2003 Posted January 5, 2020 Posted January 5, 2020 (edited) I need to find a whole line, how to do this? _GUICtrlRichEdit_FindText($hRichEdit1, $temp, True, False, True) I tried different options @CR @CRLF for $temp, none of them work. Edited January 5, 2020 by mike2003
Nine Posted January 5, 2020 Posted January 5, 2020 (edited) I suggest you read each line one after the other with_GUICtrlRichEdit_GetTextInLine based on the number of lines obtained with _GUICtrlRichEdit_GetLineCount. If there a match you got your line... Edit : I tested _GUICtrlRichEdit_FindText with @CR and it is working for me. But the approach I suggested is more robust. Edited January 5, 2020 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
mike2003 Posted January 5, 2020 Author Posted January 5, 2020 (edited) Let's see your example. I tried this $temp & @CR, and it only works at the end (bottom, last line). And it doesn't work in the middle line.@CR & $temp It doesn't work at all. Edited January 5, 2020 by mike2003
Nine Posted January 5, 2020 Posted January 5, 2020 It is the _GUICtrlRichEdit_FindText example that I modified to check @CR. I would rather see yours instead “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
mike2003 Posted January 5, 2020 Author Posted January 5, 2020 #include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <WindowsConstants.au3> Global $g_idLblMsg Example() Func Example() Local $hGui, $iMsg, $idBtnNext, $hRichEdit, $iStep = 0 $hGui = GUICreate("Example (" & StringTrimRight(@ScriptName, 4) & ")", 320, 350, -1, -1) $hRichEdit = _GUICtrlRichEdit_Create($hGui, "", 10, 10, 300, 220, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) _GUICtrlRichEdit_SetFont($hRichEdit, 15, "Tahoma") $g_idLblMsg = GUICtrlCreateLabel("", 10, 235, 300, 60) GUISetState(@SW_SHOW) _GUICtrlRichEdit_AppendText($hRichEdit, "This is a test.") _GUICtrlRichEdit_AppendText($hRichEdit, @CRLF & "This is appended text.") _GUICtrlRichEdit_AppendText($hRichEdit, @CRLF & "appended text") _GUICtrlRichEdit_AppendText($hRichEdit, @CRLF & "appended text fjff") _GUICtrlRichEdit_SetSel($hRichEdit, 0, 0) $aa = _GUICtrlRichEdit_FindText($hRichEdit, "appended text" & @CR, True, False, True) _GUICtrlRichEdit_SetSel($hRichEdit, $aa, $aa + 13) GUICtrlSetData($g_idLblMsg, $aa) While True $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE _GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes Exit EndSelect WEnd EndFunc ;==>Example I took an example from help, added lines and it doesn't work.
Nine Posted January 5, 2020 Posted January 5, 2020 Just use : $aa = _GUICtrlRichEdit_FindText($hRichEdit, "appended text" & @CR) mike2003 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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