Leaderboard
Popular Content
Showing content with the highest reputation on 03/06/2023 in all areas
-
Hi All - New Release: Version 1.5. Theres been a MASSIVE update to the helpfiles, so I'm hoping they should pass as a half decent reference now. Just be aware the chm files may require "unblocking", as they'll likely get tagged as being "from the internet". Right click the file > properties > Unblock and apply. Apart from the documentation, notable changes are: - Support for 3D Audio Controllers. - Builtin routine for a midi panic button - Active sensing functionality for output devices. - midi_ReadMsg & _midi_SendMsg can work with short messages in a variety of formats (Thanks to ptrex) - Window message registration has been moved to _midi_Startup (Thanks to Peter) And a bunch more stuff that was fixed that you can find in the helpfile2 points
-
Unterminated string maybe longer than 5000 chars
Musashi and one other reacted to pixelsearch for a topic
@mistersquirrle that's interesting ! If I understood your conclusion, &= will nearly never throw a "yacc stack overflow error" (with usual big strings) when & _ will throw the error much often. Gladly I already got functional code to generate automatically these long strings to be pasted in Scite. It's useful, for example to test your comments, without creating manually the strings. Let's say first we generate this test string : 1) Script "420x - copy a string to Clipboard.au3" #include <String.au3> Local $s = _StringRepeat("1" & @lf, 1000) ClipPut($s) 2) Script "RegExpQuickTester 2.5m.au3" Paste the string in the Subject field Generate AutoIt code (which includes a generated Subject String for Scite) The generated Subject string can actually be created in 2 different ways as discussed in my precedent post. But it won't stay like that forever : one of these 2 ways has to be deleted ! 3) Script "420y - paste RegExp code here & _.au3" If RegExpQuickTester did generate the Subject string like this... ...then what you experimented happens to me too, at the very same line : My Scite Console : "420y - paste RegExp code here & _.au3" (374,15) : error: yacc stack overflow @Jos comment was interesting in this post, related to "unterminate string", when he wrote : "Anyway, you can also opt for not running au3check, but you will still have to fix your code to ensure it runs with autoit3." He's right, if we don't run Au3check in this special case, then we won't be warned about this "error: yacc stack overflow" and the script will still run without error. But who likes to run a script without running Au3check before ? 4) Script "420z - paste RegExp code there &=.au3" If RegExpQuickTester did generate the Subject string like that... ...then 3 lines only are enough and pasted in Scite, each one being approx. 4000 characters Which means about 333 & and 333 @lf per line Au3check won't signal any error, great ! Concerning this last test, let's push the limit and multiply by 100, which means repeating the string 100.000 times : Local $s = _StringRepeat("1" & @lf, 100000) 300 lines in Scite, each one being approx. 4000 characters Which means about 333 & and 333 @lf per line Au3check doesn't signal any error, great ! My conclusion (same as yours) is that it seems better to use &= rather than & _ when it comes to big strings splitted over several lines. It will avoid the "error: yacc stack overflow" with nearly all usual big files contents, when transformed to a single string pasted in Scite. We just need to remember the 4095 characters size limit for a single line pasted in Scite.2 points -
Unterminated string maybe longer than 5000 chars
Musashi and one other reacted to mistersquirrle for a topic
@pixelsearch I did some testing and the actual length of the string didn't matter, but I got the yacc stack overflow error after 250 lines, both when the lines were 4000 chars each, and when they were just 3 chars each, when it was like "1" & @LF & @LF & _. I then tested it as "1" & @LF & @LF & @LF & _, and it failed at 187 lines, with 4x @LF it failed at 150 lines, line 107 with 6x @LF. It also didn't matter if it was LF or CRLF. When I put the @LF or @CRLF into a separate variable, I had no issues until I added more lines, then with 6x line breaks in a variable it failed at 374 lines. Same when I made the variable 12x and 24x line breaks, so that overflow was unrelated to the amount of linebreaks. So now I figure it's just the amount of &'s used per line. So with just '' & _, it fails at line 748. With just a bunch of '' & '' & '' & '', it failed at column 3756 on the first line (still yacc overflow). So that was right before the 748th &, and before any underscore to go onto a new line, even without any extra lines with _. So there's some more information on it, whatever yacc is fails after 747 &'s for a single "line". Doing 747 &'s then a new line with $sString &= '' & '' & '' & '' works fine, even after 1000 lines of 747 &'s onto the same string.2 points -
Hi all, Attached below are two segments of this project. The first "Midi API" is a wrap of the windows functions below. https://docs.microsoft.com/en-us/windows/win32/multimedia/midi-functions The second "Midi UDF" library is built on the first, and aims to provide a user friendly code base for people working with midi. This UDF so far covers: Channel Voice and Mode Messaging Registered Parameters (Channel Tuning, Mod Wheel/Pitch Bend ranges) Some prolific Non-Registered Parameters. Drum editing Envelope control Vibrato control Filter control General SysEx messaging Roland Data Transfer (DT1/RQ1) Yamaha XG Data Transfer & SysEx Parameter Control Global parameter control (GM2 Reverb & Chorus control) Device Control (Master Volume/Balance/Tuning) Octive/Scale Tuning Controller Destination settings (aftertouch/cc modulation editing) Active Sensing for Output Devices 3D Sound Controllers Midi Show Control - General Commands Importing and exporting midi files (experimental) Recording midi event sequences. (experimental) Midi Machine Control is currently not supported. Thank yous A quick shoutout shoutout to Water and Mr_Creator for the Simple Library Docs Generator - which was the originaly the basis of the helpfiles. Also a double to Water for the advanced help example (f1 key integration with scite). A couple of notes on synths. I've based the UDF on a couple of different RPs published many years apart, so implementation can be quite instrument specific. Don't expect too much of the builtin MS Wavetable Synth! I've had some more joy with the coolsoft midisynth with the choriumRevA soundfont if anyone is looking for a free alternative to test with. The two software synths mentioned above are also very slow responding to midi messages. If you forward messages to a physical instrument you should be able to play in real time. Previous versions: If anyone is after a previous release, they are all available on the sourceforge page. midi.zip1 point
-
Moved to the appropriate AutoIt General Help and Support forum, as the AutoIt Example Scripts forum very clearly states: Moderation Team1 point
-
Unterminated string maybe longer than 5000 chars
Musashi reacted to pixelsearch for a topic
Thanks for your input imho, the stack size you increased several times shouldn't be changed anymore, because there IS already a solution to solve this kind of situation, I'll indicate it again at the end of this post. First, let's have a look at another Forum thread, dated from 2016, title "error: yacc stack overflow". In this thread, OP showed a string having 261 lines and his comment was : "This code causes an error: yacc stack overflow on line 249" Global $g_R2 = '1|0.1382|0.0031' & @CRLF & _ '2|0.1696|0.003' & @CRLF & _ '3|0.1994|0.003' & @CRLF & _ .... '258|26.3468|0.0062' & @CRLF & _ '259|26.4083|0.0062' & @CRLF & _ '260|26.47|0.0059' & @CRLF & _ '261|26.5295|0.0056' Jos answered in the same thread : "I can fix the stack overflow with au3check in case is required by increasing it." Jos certainly increased it, as OP's string will actually (in 2023) generate the error when it reaches this limit : "(374,38) : error: yacc stack overflow" Now if we remove a single line from the string, the error disappears : No yacc error in the pic above Then I was intrigued when OP wrote : "Replaced @CRLF on a colon delimiter (:) and all was good. Thank you." Why intrigued ? Because the following code still generates the error, which shows that @CRLF has nothing to do with the "yacc stack overflow" error (thanks to @mistersquirrle who indicated it in his post above) (374,36) : error: yacc stack overflow Now If we divide the number of ampersands (&) by 2, after integrating the colon that solved OP's issue, the limit is reached below, when the number of lines is doubled : (748,31) : error: yacc stack overflow Removing 1 line makes the error disappear : No yacc error in the pic above So this yacc error is really related to the number of ampersands (&) found in code while a string is being parsed. It has nothing to do with the line breaks or any other character (if I'm not mistaken) @Melba23 answered this to OP : "At a guess you are running into some form of line limit within Au3Check - hence the "yacc" error. Have you thought of changing the manner in which you store the data? Perhaps an array might be more suitable than a @CRLF delimited string." imho the answer we all should give to users facing this situation is : "If you really want to integrate this kind of string directly in your script, then don't use the & _ syntax, but use the &= syntax to get rid of this yacc error" This last picture will show you why : 10.000 lines, no yacc error and all is good. The example indicated by mistersquirrle ('' & '' & '' & '' failed at column 3756 on the first line) isn't a real-life example and will still generate a yacc error. He indicated it just for tests. Real-life examples (as discussed above) shouldn't face the yacc issue anymore... if the syntax &= is used.1 point -
lesmly, Nice catch! The Context menu is being created within the GUIExtender structure, but of course cannot be hidden/restored like a normal control. The solution is to create the menu outside of the GUIExtender structure like this: #include <GUIConstantsEx.au3> #include <GUIConstants.au3> #include "GUIExtender.au3" $hGUI = GUICreate("Test", 400, 300) _GUIExtender_Init($hGUI, 1) _GUIExtender_Section_Create($hGUI, 0, 100) _GUIExtender_Section_Activate($hGUI, 1) GUICtrlCreateLabel("", 0, 0, 100, 300) GUICtrlSetBkColor(-1, 0xFFCCCC) _GUIExtender_Section_Create($hGUI, 100, 200) $cButton_1 = GUICtrlCreateButton(">>", 110, 10, 20, 30) $cButton_2 = GUICtrlCreateButton("<<", 260, 10, 20, 30) ; $listlistylst = GUICtrlCreateListView("My List", 150, 20, 70, 162) ; _GUIExtender_Section_Create($hGUI, 300, 100) _GUIExtender_Section_Activate($hGUI, 3) GUICtrlCreateLabel("", 300, 0, 100, 300) GUICtrlSetBkColor(-1, 0xCCCCFF) _GUIExtender_Section_Create($hGUI, -99) $hCMenuLST = GUICtrlCreateContextMenu($listlistylst) $hCMenuzaznacz = GUICtrlCreateMenu("Check", $hCMenuLST) $hCmenu2p = GUICtrlCreateMenuItem("2 floor", $hCMenuzaznacz) $hCmenu3p = GUICtrlCreateMenuItem("3 floor", $hCMenuzaznacz) GUISetState() While 1 $aMsg = GUIGetMsg(1) Switch $aMsg[0] Case $GUI_EVENT_CLOSE Exit Case $cButton_1 Switch _GUIExtender_Section_State($hGUI, 1) Case 0 ; Extend to the left - override default _GUIExtender_Section_Action($hGUI, 1, 1, 2) GUICtrlSetData($cButton_1, ">>") Case 1 ; Retract from the left - override default _GUIExtender_Section_Action($hGUI, 1, 0, 2) GUICtrlSetData($cButton_1, "<<") EndSwitch Case $cButton_2 Switch _GUIExtender_Section_State($hGUI, 3) Case 0 ; Extend to the right (default) _GUIExtender_Section_Action($hGUI, 3) GUICtrlSetData($cButton_2, "<<") Case 1 ; Retract from the right (default _GUIExtender_Section_Action($hGUI, 3, 0) GUICtrlSetData($cButton_2, ">>") EndSwitch EndSwitch _GUIExtender_EventMonitor($aMsg[1], $aMsg[0]) WEnd Let me know if that does not work for you - it certainly does for me! M231 point
-
Download PDF file while using Webdriver
SOLVE-SMART reacted to mLipok for a topic
here: https://scripteverything.com/download-pdf-selenium-python/ I found this: I think that we can do the same1 point -
@ScriptName does not use #include file
argumentum reacted to Jos for a topic
Looks indeed like an issue after making 2 simple replicator scripts: Test.au3: ; Script test.au3 #include "test2.au3" ConsoleWrite('@@> Debug(' & @ScriptLineNumber & ') : @ScriptName= ' & @ScriptName & @CRLF) ;### Debug Console Test() ConsoleWrite('@@> Debug(' & @ScriptLineNumber & ') : @ScriptName= ' & @ScriptName & @CRLF) ;### Debug Console Test2.au3: ; Script test2.au3 Func test() ConsoleWrite('@@- Debug(' & @ScriptLineNumber & ') : @ScriptName= ' & @ScriptName & @CRLF) ;### Debug Console ConsoleWrite('@@- Debug(' & @ScriptLineNumber & ') : @ScriptName= ' & @ScriptName & @CRLF) ;### Debug Console EndFunc ;==>test Output: >Running:(3.3.16.1):C:\Program Files (x86)\AutoIt3\autoit3.exe "D:\Development\AutoIt3\programs\test\test\test.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart. --> Press Ctrl+BREAK to Stop. @@> Debug(2) : @ScriptName= test.au3 @@- Debug(3) : @ScriptName= test.au3 @@- Debug(4) : @ScriptName= test.au3 @@> Debug(4) : @ScriptName= test.au3 +>09:16:59 AutoIt3 ended. rc:01 point -
ShareX.exe -ColorPicker
argumentum reacted to ioa747 for a topic
@argumentum I'm glad you like it, I enjoyed it too You are right, in the beginning, in the first editions, and I had it portable, but over time it won a place in the installed programs. nevertheless, your addition is a nice touch, that's why I adopted it, and ReUpDate thanks for that and since you expressed the, I didn't get how it worked. ControlClick($hShareX, "", "[NAME:btnClipboardColorPicker]") the rest is simple give and take with GUI I think this will solve your questions PS in the function you posted, StringTrimLeft garlic - onion Thanks for everything !1 point -
ShareX.exe -ColorPicker
ioa747 reacted to argumentum for a topic
nice LoadIfNeeded() Func LoadIfNeeded() Local $sFullPath = "C:\Program Files\ShareX\ShareX.exe" If Not WinExists("ShareX - Color picker") Then If Not FileExists($sFullPath) Then $sFullPath = @ScriptDir & "\ShareX.exe" If Not FileExists($sFullPath) Then $sFullPath = @ScriptDir & "\ShareX\ShareX.exe" If Not FileExists($sFullPath) Then Exit MsgBox(262144, StringTrimLeft(@ScriptName, 4), "Kindly tell the script where to find ShareX.exe, bye now.", 10) Run('"' & $sFullPath & '" -ColorPicker' ) EndIf EndFunc I didn't get how it worked. I'm using it in portable mode.1 point -
Learning other languages
SanityChecker reacted to Werty for a topic
I use TCC (Tiny C Compiler) together with autoit, it's very small and commandline no IDE, i dont know about sockets, but a quick glance at google shows there's plenty about websockets using C available. TinyCC: https://bellard.org/tcc/ Example of usage with autoit...1 point