TheAutomator Posted December 30, 2019 Share Posted December 30, 2019 (edited) Moderator note: See later posts - the OP found that the problem was not sound related ############################################################### Having issues using soundplay('wavfile.wav', 0) the sound is supposed to play while there is stuff written to an edit control. sometimes it works, sometimes the GUI just freezes and I have to ctrl-alt-del... the sound file is 10 seconds long and uses 0 as the soundplay parameter to play it async. sometimes sleep is used for 50 milliseconds while the sound is still playing. any others having issues with this? 🤔 debug code: !>22:50:40 AutoIt3.exe ended.rc:-805306369 Edited January 17, 2020 by Melba23 Amended title to reflect actual problem Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 30, 2019 Moderators Share Posted December 30, 2019 @TheAutomator a little difficult to assist with no code posted. What error handling do you have in place? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
TheAutomator Posted December 30, 2019 Author Share Posted December 30, 2019 (edited) 11 hours ago, JLogan3o13 said: @TheAutomator a little difficult to assist with no code posted. What error handling do you have in place? i'm sorry.. i tried narrowing it down and i couldn't recreate the crash that way the code is kinda huge 😅 can you tell me what you mean exactly with "what kinda error handling"? i'm using the autoit editor and the crash appears to happen wile appending some text after a short pause with sleep() it freezes and when i end the task the error code above in the debug console is all i have.. edit: it's also random, maybe it's my pc or a driver problem i'll post some code from the moment i can replicate the error Edited December 31, 2019 by TheAutomator Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone Link to comment Share on other sites More sharing options...
TheAutomator Posted January 15, 2020 Author Share Posted January 15, 2020 (edited) this is driving me nuts! i now have the problem reappearing every exact same time... it appears that the issue comes from a specific string it has to write to the edit control at a certain moment.. then autoit freezes. this was also the case a few other times with this script, but on different places... whyyy when i alter that string with only one single character or a different timing it works fine, else not... its just a bunch of random characters and a newline character (exactly there it stops). if i type something before or after the 'crlf' character (that's in the middle of the string) it suddenly just works fine... even more strange, if i press CTRL + BREAK to stop the frozen script with the editor the mouse arrow starts moving to the right bottom corner of my screen? what the..? Edited January 15, 2020 by TheAutomator Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted January 15, 2020 Moderators Share Posted January 15, 2020 Again, how can anyone help you without seeing code??? If the code is "kinda huge" then try a reproducer that demonstrates the problem. Otherwise, you're asking us to first guess at what you're doing and then help you troubleshoot. On 12/30/2019 at 6:13 PM, TheAutomator said: can you tell me what you mean exactly with "what kinda error handling"? Take a look at the FAQ in the Wiki; very first section is "How can I debug my script?". This is where you should start when trying to track down a bug in the code. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
TheAutomator Posted January 16, 2020 Author Share Posted January 16, 2020 expandcollapse popup#include <guiconstantsex.au3> #include <buttonconstants.au3> #include <windowsconstants.au3> #include <guiedit.au3> ;-------------------------------------------------------------------------------------------------- const $form = guicreate('TypingError', 600, 400, default, default, bitor($gui_ss_default_gui,$ws_maximizebox,$ws_sizebox,$ws_thickframe,$ws_tabstop)) guisetbkcolor(0x400000) const $console = guictrlcreateedit('loading...', 10, 10, 581, 341, bitor($es_autovscroll,$es_readonly,$es_wantreturn,$ws_vscroll), 0) guictrlsetfont(default, 12, 800, 0, 'consolas') guictrlsetcolor(default, 0xffffff) guictrlsetbkcolor(default, 0x000000) guictrlsetresizing(default, bitor($gui_dockleft,$gui_dockright,$gui_docktop,$gui_dockbottom)) guictrlsetcursor (default, 3) const $user = guictrlcreateinput('', 10, 360, 521, 30, default, 0) guictrlsetfont(default, 14, 800, 0, 'consolas') guictrlsetcolor(default, 0xffffff) guictrlsetbkcolor(default, 0x000000) guictrlsetresizing(default, bitor($gui_dockleft,$gui_dockright,$gui_dockbottom,$gui_dockwidth,$gui_dockheight)) const $send = guictrlcreatebutton('send', 540, 360, 51, 31, bitor($es_uppercase,$bs_defpushbutton,$ws_disabled)) guictrlsetresizing(default, bitor($gui_dockright,$gui_dockbottom,$gui_dockwidth,$gui_dockheight)) guictrlsetcursor (default, 0) guisetstate(@sw_show) ;-------------------------------------------------------------------------------------------------- Global $clear = False func WRITE($message) if $clear then $clear = False else _guictrledit_appendtext($console, @crlf) endif ADD($message) endfunc Func ADD($message) for $i = 1 to stringlen($message) sleep(50) _guictrledit_appendtext($console, stringmid($message, $i, 1)) next EndFunc func READ() guictrlsetstate($send, $gui_enable) while 1 switch guigetmsg() case $gui_event_close exit case $send guictrlsetstate($send, $gui_disable) local $answer = guictrlread($user) guictrlsetdata($user, '') return $answer endswitch wend endfunc HotKeySet('{esc}','quit') func QUIT() write("goodbye...") exit endfunc ;-------------------------------------------------------------------------------------------------- write('this a test of a string with the ' & @CRLF & 'character in it...') read() Sleep(1000) $clear = True GUICtrlSetData($console, '') write('this a test of qdfgdqfgqdfga string with the ' & @CRLF & 'character in it...');PROBLEM! read() write('this a test oqdgff a string with the ' & @CRLF & 'character in it...') read() write('this a t... cbgfshf...e?' & @CRLF & 'character in it...') read() write('done') I finally managed to narrow it down to this, and i can replicate the bug. I'm sorry for the inconvienience but the code for this one was huge, lots of nesting and arrays with strings readed from files and stuff.. but it seems that this example shows where the gui freezes. Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone Link to comment Share on other sites More sharing options...
TheAutomator Posted January 16, 2020 Author Share Posted January 16, 2020 (edited) just press enter after every sentence, there is one crashing my script every time: write('this a test of qdfgdqfgqdfga string with the ' & @CRLF & 'character in it...');PROBLEM! if i alter the sentence or i remove or change a few of the other strings.... it works? if i press CTRL+BREAK when the script freezes, the mousepointer moves to the screencorner also? Edited January 16, 2020 by TheAutomator image Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone Link to comment Share on other sites More sharing options...
Nine Posted January 16, 2020 Share Posted January 16, 2020 Works without issue on Win7 ! “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) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
TheAutomator Posted January 16, 2020 Author Share Posted January 16, 2020 1 minute ago, Nine said: Works without issue on Win7 ! windows 10 user here, maybe it's related to that? i'm not sure.. compatibility bug? question, did you also test it on a w10 system afterwards? i tested this on my home pc (w10) and the one at work (w10) with the same results, a crash. Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone Link to comment Share on other sites More sharing options...
Nine Posted January 16, 2020 Share Posted January 16, 2020 Yes I got the same problem on win 10 “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) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
TheAutomator Posted January 16, 2020 Author Share Posted January 16, 2020 (edited) 3 minutes ago, Nine said: Yes I got the same problem on win 10 so weird, even a single character can change if it works or not.. guess i was extremely lucky with finding the right sentences to replicate this bug. hah asking the mods to change the title of this post because sound is actually not the problem.. Edited January 16, 2020 by TheAutomator Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone Link to comment Share on other sites More sharing options...
Nine Posted January 16, 2020 Share Posted January 16, 2020 I suggest you report it in Bug Tracker as it seems it is really a bug with Win 10... “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) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
TheAutomator Posted January 16, 2020 Author Share Posted January 16, 2020 https://www.autoitscript.com/trac/autoit/ticket/3745 Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone Link to comment Share on other sites More sharing options...
TheAutomator Posted January 17, 2020 Author Share Posted January 17, 2020 I never posted a ticket before but this one seems quite important.. do you get notified about it? I don't know a workaround for this one... 😕 wish i could finish my script. fingers crossed! Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 17, 2020 Moderators Share Posted January 17, 2020 TheAutomator, There is no automatic alert for bugs, but we check Trac regularly. And I have amended the thread title as you requested. I can certainly reproduce the problem and I am trying to see if I can find a pattern to what actually triggers the freezing - at the moment the script seems to be waiting at the Sleep(50) line but I cannot understand why this should occur. There also appears to be little pattern to the makeup of the string preceding the @CRLF as I can get the same symptoms using other character combinations - so the particular string you used does not appear to be "magic" in any particular way. I did wonder if the actual location of the @CRLF within the string was critical, but again it does not seem to be the case from my tests so far. I will keep plugging away and see if I can come up with something. M23 TheAutomator and Musashi 1 1 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...
TheAutomator Posted January 17, 2020 Author Share Posted January 17, 2020 (edited) Melba23, Thanks for letting me know! (and for changing the topic title). [edit: not nesesairly _GUICtrlEdit_AppendText, guictrlsetdata(..., ..., 1) does the same here] I modified that pseudo-magic string by one or two characters and that sometimes makes it work again or makes it stop working again.. I think it also freezes without the sleep(50) in some cases. At the start i didn't even know how to reproduce this crash because it was so vague where it came from, lucky i found out it had nothing to do with sound or the size of my script. I'm glad you saw this post, and hopefully you guys don't have to much trouble figuring out what the reason for this bug is.. if something comes up and it gets fixed i'll read it here? or do i check regularly for a new autoit version? regards Edited January 17, 2020 by TheAutomator about the topic title Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 17, 2020 Moderators Share Posted January 17, 2020 TheAutomator, I have narrowed the problem down to the early lines of your WRITE function - appending @CRLF to the empty edit seems to be the culprit in my testing so far, but I have no idea why this is the case. Good job I have a free afternoon to continue my detective work! You will read about any fix in Trac where we follow-up reports. And I doubt we will need a new AutoIt version to solve this, so no need to check. 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...
AutoBert Posted January 18, 2020 Share Posted January 18, 2020 The problem in your script is the func write. I don't understand why but after testing with little modification it runs: expandcollapse popup#include <guiconstantsex.au3> #include <buttonconstants.au3> #include <windowsconstants.au3> #include <guiedit.au3> ;-------------------------------------------------------------------------------------------------- const $form = guicreate('TypingError', 600, 400, default, default, bitor($gui_ss_default_gui,$ws_maximizebox,$ws_sizebox,$ws_thickframe,$ws_tabstop)) guisetbkcolor(0x400000) const $console = guictrlcreateedit('loading...', 10, 10, 581, 341, bitor($es_autovscroll,$es_readonly,$es_wantreturn,$ws_vscroll), 0) guictrlsetfont(default, 12, 800, 0, 'consolas') guictrlsetcolor(default, 0xffffff) guictrlsetbkcolor(default, 0x000000) guictrlsetresizing(default, bitor($gui_dockleft,$gui_dockright,$gui_docktop,$gui_dockbottom)) guictrlsetcursor (default, 3) const $user = guictrlcreateinput('', 10, 360, 521, 30, default, 0) guictrlsetfont(default, 14, 800, 0, 'consolas') guictrlsetcolor(default, 0xffffff) guictrlsetbkcolor(default, 0x000000) guictrlsetresizing(default, bitor($gui_dockleft,$gui_dockright,$gui_dockbottom,$gui_dockwidth,$gui_dockheight)) const $send = guictrlcreatebutton('send', 540, 360, 51, 31, bitor($es_uppercase,$bs_defpushbutton,$ws_disabled)) guictrlsetresizing(default, bitor($gui_dockright,$gui_dockbottom,$gui_dockwidth,$gui_dockheight)) guictrlsetcursor (default, 0) guisetstate(@sw_show) ;-------------------------------------------------------------------------------------------------- Global $clear = False func WRITE($message) if $clear then $clear = False ADD($message & @CRLF) else _guictrledit_appendtext($console, $message & @crlf) $clear = True ;can be deleted if no need for endif endfunc Func ADD($message) for $i = 1 to stringlen($message) sleep(50) _guictrledit_appendtext($console, stringmid($message, $i, 1)) next EndFunc func READ() guictrlsetstate($send, $gui_enable) while 1 switch guigetmsg() case $gui_event_close exit case $send guictrlsetstate($send, $gui_disable) local $answer = guictrlread($user) guictrlsetdata($user, '') return $answer endswitch wend endfunc HotKeySet('{esc}','quit') func QUIT() write("goodbye...") exit endfunc ;-------------------------------------------------------------------------------------------------- write('this a test of a string with the ' & @CRLF & 'character in it...') read() Sleep(1000) GUICtrlSetData($console, '') $clear = True write('this a test of qdfgdqfgqdfga string with the ' & @CRLF & 'character in it...');PROBLEM! $answer = read() write('this a test oqdgff a string with the ' & @CRLF & 'answer in it: ' & $answer) read() write('this a t... cbgfshf...e?' & @CRLF & 'character in it...') read() write('done') Link to comment Share on other sites More sharing options...
TheAutomator Posted January 19, 2020 Author Share Posted January 19, 2020 (edited) AutoBert, Interesting, now i can at least use the function again, thanks for that TheAutomator [EDIT:] didn't see you removed the delay of the text to be typed, that's still needed.. Edited January 20, 2020 by TheAutomator Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone Link to comment Share on other sites More sharing options...
TheAutomator Posted February 9, 2020 Author Share Posted February 9, 2020 On 1/17/2020 at 12:20 PM, Melba23 said: TheAutomator, I have narrowed the problem down to the early lines of your WRITE function - appending @CRLF to the empty edit seems to be the culprit in my testing so far, but I have no idea why this is the case. Good job I have a free afternoon to continue my detective work! You will read about any fix in Trac where we follow-up reports. And I doubt we will need a new AutoIt version to solve this, so no need to check. M23 Any updates on this? I'm sorry for looking impatient 😅 I regularly check the bug tracker for a while now, nothing changes and not being able to add text to an edit control is quite inconvenient 😕 Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone 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