akandesh Posted March 23, 2018 Share Posted March 23, 2018 I've spent many hours on this issue today without finding anything that works. Tried just calling _GUICtrlRichEdit_AppendText($hWnd, "test" & @CRTF) and still not giving me another line at the end. Here's a ready to run test script: https://ghostbin.com/paste/m8yre (I'm aware there's way too many includes) Whoever helps me find what's wrong is a godsend and I'll be forever grateful. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 23, 2018 Moderators Share Posted March 23, 2018 akandesh, Welcome to the AutoIt forums. Spot the difference: expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiEdit.au3> #include <GuiRichEdit.au3> $Form1 = GUICreate("Log", 600, 400, 200, 150) ; Perhaps if you tell the RichEdit that it is multi-line and should honour @CRLF? <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Global $editctrl = _GUICtrlRichEdit_Create($Form1, "", 10, 10, 580, 330, BitOR($ES_MULTILINE, $ES_READONLY)) Global $button = GUICtrlCreateButton("Log", 10, 350, 80, 30) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $button function1() EndSwitch WEnd Func function1() ; No need to add a @CRLF - the function does it for you <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< _GUICtrlRichEdit_WriteLine($editctrl, "Test", Default, Default, 0x38761D) EndFunc ;==>function1 Func _GUICtrlRichEdit_WriteLine($hWnd, $sText, $iIncrement = 0, $sAttrib = "", $iColor = -1) ; Count the @CRLFs StringReplace(_GUICtrlRichEdit_GetText($hWnd, True), @CRLF, "") Local $iLines = @extended ; Adjust the text char count to account for the @CRLFs Local $iEndPoint = _GUICtrlRichEdit_GetTextLength($hWnd, True, True) - $iLines ; Add new text _GUICtrlRichEdit_AppendText($hWnd, $sText & @CRLF) ; @CRLF added by the function <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ; Select text between old and new end points _GUICtrlRichEdit_SetSel($hWnd, $iEndPoint, -1) ; Convert colour from RGB to BGR $iColor = Hex($iColor, 6) $iColor = '0x' & StringMid($iColor, 5, 2) & StringMid($iColor, 3, 2) & StringMid($iColor, 1, 2) ; Set colour If $iColor <> -1 Then _GUICtrlRichEdit_SetCharColor($hWnd, $iColor) ; Set size If $iIncrement <> 0 Then _GUICtrlRichEdit_ChangeFontSize($hWnd, $iIncrement) ; Set weight If $sAttrib <> "" Then _GUICtrlRichEdit_SetCharAttributes($hWnd, $sAttrib) ; Clear selection _GUICtrlRichEdit_Deselect($hWnd) EndFunc ;==>_GUICtrlRichEdit_WriteLine And when you post code in future please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
akandesh Posted March 23, 2018 Author Share Posted March 23, 2018 (edited) Thanks a ton! Off-topic question: How do I make the ScLite editor show output when I run my scripts through Tools->Go? Only thing I get is things like this: I always have to debug by running the script outside of the editor and I know there's ways of seeing outputs and such in the editor, so how? Edited March 23, 2018 by Melba23 Quote removed Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 23, 2018 Moderators Share Posted March 23, 2018 akandesh, When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unnecessarily. To display output in SciTE, just use ConsoleWrite to show the variable content - for arrays you need _ArrayDisplay. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
akandesh Posted March 23, 2018 Author Share Posted March 23, 2018 Sorry. This doesn't work for me. I never get any output nor any error messages. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 23, 2018 Developers Share Posted March 23, 2018 In which directory is autoit3.exe located on your computer? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
akandesh Posted March 23, 2018 Author Share Posted March 23, 2018 It's located in C:\Program Files (x86)\AutoIt3. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 23, 2018 Developers Share Posted March 23, 2018 (edited) Then you need to use the SciTE located in C:\Program Files (x86)\AutoIt3\Scite for things to work! Jos Edited March 23, 2018 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
akandesh Posted March 23, 2018 Author Share Posted March 23, 2018 Hmm how do I change that? I tried running that one but seems like it runs from some ProgramData folder anyways. Same result. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 23, 2018 Developers Share Posted March 23, 2018 (edited) The installer didn't do this so it must be something you have done manually! Close the current one and start the indicated one andshow us the output again, but this time simply cut&paste the output text. Jos Edited March 23, 2018 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
akandesh Posted March 23, 2018 Author Share Posted March 23, 2018 I already did. I even uninstalled the "official" version of it since I tried that earlier when I couldn't find how to change the looks of it (still cant). The output is: >"C:\ProgramData\SciTE\..\autoit3.exe" /ErrorStdOut "O:\AutoIt Scripts\test\ConsoleWrite.au3" The filename, directory name, or volume label syntax is incorrect. >Exit code: 1 Time: 0.05965 Link to comment Share on other sites More sharing options...
Developers Jos Posted March 23, 2018 Developers Share Posted March 23, 2018 I do not think you started the version in C:\Program Files (x86)\AutoIt3\Scite ! Did you first close current SciTE session and then start that one? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
akandesh Posted March 23, 2018 Author Share Posted March 23, 2018 Indeed I did. Even checked the task manager. Willing to give you AnyDesk/Teamviewer access if you don't believe me. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 23, 2018 Developers Share Posted March 23, 2018 Ok, can you check for any enviroment variable by stating CMD en show me the result for: set sc Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
akandesh Posted March 23, 2018 Author Share Posted March 23, 2018 Link to comment Share on other sites More sharing options...
Developers Jos Posted March 23, 2018 Developers Share Posted March 23, 2018 As you can see, somebody somehow set the SCITE_HOME to that place which is simply wrong and needs to be : "C:\Program Files (x86)\AutoIt3\Scite" Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
akandesh Posted March 23, 2018 Author Share Posted March 23, 2018 Must've been the "official" installer then. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 23, 2018 Developers Share Posted March 23, 2018 SciTE4AutoIt3 installer? That will install to the same directory were the AutoIt3 installer installed to... and on top of that: You are not running that version at all at this moment! So, does it work when you change it? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
akandesh Posted March 23, 2018 Author Share Posted March 23, 2018 Can't figure out how to change it. Even did some googling and it's not in enviroment variables. :upside_down: https://www.ebswift.com/scite-text-editor-installer.html This is what I installed, doesn't even support autoit hah. Earthshine 1 Link to comment Share on other sites More sharing options...
Developers Jos Posted March 23, 2018 Developers Share Posted March 23, 2018 (edited) That is not my installer, so can't help you there! So that means you have another SciTE setup stored in "C:\ProgramData\SciTE" ? You probably best use the setupfiles from the Full version and store them in that setup and adapt accordingly. Jos Edited March 23, 2018 by Jos Earthshine 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
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