Jump to content

Search the Community

Showing results for tags 'BUG'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

  1. Hi, I think I found a bug for Opt OnEventMode. If I use 0, it does not work for on event mode. If I use 1, it does, as expected. But if I use 2 or 3 it will also work. Not terrible but a bug, it seems.
  2. I plan to write an Au3 script to automatically install a PPT plug-in. Because the button on the installation wizard of the PPT plug-in is not a standard control, I consider writing a while loop to constantly judge the color of a specific location on the installation wizard. When the plug-in is successfully installed, a blue "Start Software" button will appear at this location, so that I can let the script close the installation wizard window. But when I used the PixelGetColor function, the script did not get the color of the button on the installation wizard. On the contrary, it went through this foreground window and got the color of my desktop background! However, Au3's window information tool can correctly return the color of this position. The following is my script code (due to different configurations, some coordinates may need to be changed when testing on other devices): ;~ Run plug-in installation package #RequireAdmin run(@ScriptDir & "\FocoSlide.exe") ;~ In each installation, the number behind this class is different, so you need to use wildcards to match the window. $tittle = "[REGEXPCLASS:HwndWrapper*]" WinWait($tittle) ;~ Change the installation path WinActivate($tittle) Send("+{TAB}") Send("+{TAB}") Send("+{END}") Send("{DELETE}") ControlSend($tittle, "", "", "C:\Program Files (x86)\OfficePlugins\Foco") ;~ Switch focus to "Install" button and enter to confirm Send("+{TAB}") Send("{ENTER}") $wh = WinGetHandle($tittle) ;~ Wait for the "Start Software" button to appear (installation is complete) ;~ Activate the window before each color acquisition to avoid potential errors. WinActivate($tittle) $s = PixelGetColor(763, 533, $wh) ConsoleWrite("color is " & Hex($s, 6) & @CR) While Hex($s) <> "0267EC" Sleep(3000) $s = PixelGetColor(763, 533, $wh) ConsoleWrite("color is " & Hex($s, 6) & @CR) WinActivate($tittle) WEnd ;~ When the blue Start Software button is detected, the installation is completed and the installation wizard is closed. MouseClick("left", 1043, 350) Exit Au3 version: 3.3.16.1 Operating system: Win11
  3. As the title says, when a script that is stored on a Google Drive File Stream drive is ran or compiled, it fails to work at all. Basically, Google Drive File Stream creates a G:\ drive where you can access all your files. The difference between this and Google Backup and Sync is your files are downloaded as needed rather than they always be downloaded and taking up storage. How to Reproduce Bug 1. Download and Install Google Drive File Stream 2. Sign into Google Drive File Stream with a G Suite account. 3. Create a AutoIt Script and save it to Google Drive File Stream. (See attached file) 4. Attempt to run or compile this AutoIt Script. AutoIt appears to act like the script is (incorrectly) empty and ends immediately. (You can kind of tell based on file sizes from a successful and failed compile). I've also attached a Process Monitor log file. Hopefully someone can figure this out, because having to move the script out of the drive just to run or compile it is super annoying and I lose version revisioning Google Drive provides me. test.au3 Logfile.PML
  4. #include <GUIConstantsEx.au3> Global $iExitLoop = 0, $hGUIParent1, $hGUIParent2, $iLoadGuiTwo = 0 Example1() ;~ Example2() ; not an example but a GUI ? Func Example1($iParent = 0) Opt("GUIOnEventMode", 1) $hGUIParent1 = GUICreate("Parent", 400, 300, -1, -1, -1, -1, $iParent) GUISetOnEvent($GUI_EVENT_CLOSE, "OnEvent_CLOSE_ONE", $hGUIParent1) GUICtrlCreateButton("load GUI TWO", 8, 8, 100) GUICtrlSetOnEvent(-1, "LoadGuiTwoFromGuiOne") GUISetState(@SW_SHOW) While 1 ; Loop until the user exits. Sleep(100) ;~ If $iLoadGuiTwo Then ; .......... solution 1 ;~ Example2($hGUIParent1) ; .... ;~ $iLoadGuiTwo = 0 ; .......... ;~ EndIf ; ......................... If $iExitLoop Then ExitLoop WEnd $iExitLoop = 0 GUIDelete($hGUIParent1) EndFunc ;==>Example1 Func Example2($iParent = 0) Opt("GUIOnEventMode", 1) $hGUIParent2 = GUICreate("Child", 300, 400, -1, -1, -1, -1, $iParent) GUISetOnEvent($GUI_EVENT_CLOSE, "OnEvent_CLOSE_TWO", $hGUIParent2) GUICtrlCreateButton("say hi", 8, 8) GUICtrlSetOnEvent(-1, "GuiTwoSayHi") GUISetState(@SW_SHOW) While 1 ; Loop until the user exits. Sleep(100) If $iExitLoop Then ExitLoop WEnd $iExitLoop = 0 GUIDelete($hGUIParent2) EndFunc ;==>Example2 Func OnEvent_CLOSE_ONE() ConsoleWrite('- Func OnEvent_CLOSE_ONE()' & @CRLF) $iExitLoop = 1 EndFunc ;==>OnEvent_CLOSE_ONE Func OnEvent_CLOSE_TWO() ConsoleWrite('- Func OnEvent_CLOSE_TWO()' & @CRLF) $iExitLoop = 1 EndFunc ;==>OnEvent_CLOSE_TWO Func LoadGuiTwoFromGuiOne() Example2($hGUIParent1) ; no solution. ;~ $iLoadGuiTwo = 1 ; solution 1 ;~ AdlibRegister("LoadGuiTwoRunner", 10) ; solution 2 EndFunc ;==>LoadGuiTwoFromGuiOne Func LoadGuiTwoRunner() AdlibUnRegister("LoadGuiTwoRunner") Example2($hGUIParent1) EndFunc ;==>LoadGuiTwoRunner Func GuiTwoSayHi() ConsoleWrite('--- HI' & @CRLF) EndFunc ;==>GuiTwoSayHi ..I was using map[] and beta and is this a bug ?. But I coded this sampler and is not a beta thing, is an production thing too. Is the code as presented supposed to fail ? ( found viable solutions, so this is not an OMG! kind of thing ) I believe that the logic would work if not GuiOnEvent mode. Edit: Tried in v3.2.12.x and v3.3.8.1 and is a design thing. Not new. I just never noticed it.
  5. #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Global $edit, $GuiChild = 0 GuiExample() Func GuiExample() ; https://www.autoitscript.com/forum/topic/202986-parent-child-guis-and-input-control-fails/ Local $GuiMain = GUICreate("GuiExample w/child (parent)", 350, 300) GUISetOnEvent($GUI_EVENT_CLOSE, "GuiOnEvent_CLOSE", $GuiMain) GUISetState(@SW_SHOW, $GuiMain) $edit = GUICtrlCreateEdit("", 10, 70, 300, 200) ; It does not matter what GUI is on, GUICtrlSetData($edit, "play around with the inputs" & _ ; the parent's controls will @CRLF & "and press enter." & _ ; bleed through a $WS_CHILD gui. @CRLF & @CRLF & "It should trigger the" & _ @CRLF & " GUICtrlSetOnEvent()") GUICtrlCreateButton("reload alt.", 225, 40, 120, 25) ; run alternate versions, GUICtrlSetOnEvent(-1, "OnBttnRunAlt") ; with and without child GUI. GUICtrlSetTip(-1, "run alternate versions," & @LF & "with and without child GUI.") ;I need this child(s), but with it, it does not behave as expected. ;..for this test you can comment it out, to see that it should work. ;..but with the child, instead it executes after clicking another control. If Not StringInStr($CmdLineRaw, "/ExampleOnlyParent") Then $GuiChild = GUICreate("GuiExample w/child (child)", 320, 280, 5, 5, $WS_CHILD, $WS_TABSTOP, $GuiMain) EndIf If $GuiChild Then GUISetBkColor(0x888888, $GuiChild) ; for the dramatic effect :) If $GuiChild Then GUISwitch($GuiChild) ; ..just in case.. tho should not matter. GUICtrlCreateInput("This text 1", 5, 10, 200, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_WANTRETURN)) GUICtrlSetOnEvent(-1, "OnInputEnterKeyOne") GUICtrlCreateInput("This text 2", 5, 35, 200, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_WANTRETURN)) GUICtrlSetOnEvent(-1, "OnInputEnterKeyTwo") If $GuiChild Then GUICtrlCreateButton("flash child", 220, 8, 120, 25) GUICtrlSetOnEvent(-1, "OnFlashBttn") GUISetState(@SW_SHOW, $GuiChild) OnFlashBttn() EndIf MainLoopExample() EndFunc Func MainLoopExample() While 1 Sleep(100) WEnd EndFunc Func OnInputEnterKeyOne() GUICtrlSetData($edit, @SEC &'.' & @MSEC& ' - Func OnInputEnterKey One ()' & @CRLF) EndFunc Func OnInputEnterKeyTwo() GUICtrlSetData($edit, @SEC &'.' & @MSEC& ' - Func OnInputEnterKey Two ()' & @CRLF) EndFunc Func OnFlashBttn() WinSetTrans($GuiChild, "", 50) Sleep(300) WinSetTrans($GuiChild, "", 255) EndFunc Func OnBttnRunAlt() If StringInStr($CmdLineRaw, "/ExampleOnlyParent") Then ShellExecute(@ScriptFullPath, "") Else ShellExecute(@ScriptFullPath, "/ExampleOnlyParent") EndIf GuiOnEvent_CLOSE() EndFunc Func GuiOnEvent_CLOSE() GUIDelete() Exit EndFunc I need this child(s), but with it, it does not behave as expected. ..for this test you can comment the child GUI out, to see that it should work. With the child, instead it executes after clicking another control. Thanks Edit: Modified the example for dramatic effect Edit 2: Solved my problems at a post somewhere down this thread.
  6. What is Rollbar? Rollbar provides real-time error alerting & debugging tools for developers. Learn more about it at https://rollbar.com/product/ Demo: https://rollbar.com/demo/demo/ Screenshot: Instructions: (RollbarTest.au3) ; Include RollbarSDK #include "RollbarSDK.au3" ;Turns on ConsoleWrite debugging override. ;Global $Rollbar_Debug=False ; Initialize RollbarSDK with the project's API key. ; Parameters ....: $__Rollbar_sToken - [Required] Go to https://rollbar.com/<User>/<ProjectName>/settings/access_tokens/ for your project. Use the token for post_server_item. _Rollbar_Init("eaa8464a4082eeabd9454465b8f0c0af") ; Write code that causes an error you want to catch, then call ; _Rollbar_Send ; Parameters ....: $__Rollbar_sErrorLevel - [Required] Must be one of the following values: Debug, Info, Warning, Error, Critical. ; $__Rollbar_sMessage - [Required] The message to be sent. This should contain any useful debugging info that will help you debug. ; $__Rollbar_sMessageSummary - [Optional] A string that will be used as the title of the Item occurrences will be grouped into. Max length 255 characters. If omitted, Rollbar will determine this on the backend. _Rollbar_Send("Debug", "This is an debug message. If you received this, you were successful!", "Debug Message") _Rollbar_Send("Info", "This is a test message. If you received this, you were successful!", "Info Message") _Rollbar_Send("Warning", "This is an warning message. If you received this, you were successful!", "Warning Message") _Rollbar_Send("Error", "This is an error message. If you received this, you were successful!", "Error Message") _Rollbar_Send("Critical", "This is an critical message. If you received this, you were successful!", "Critical Message") _Rollbar_Send("Info", "This is a test message. If you received this, you were successful!") ;No Message ; Rollbar_Send's helper functions ; Parameters ....: $__Rollbar_sMessage - [Required] The message to be sent. This should contain any useful debugging info that will help you debug. ; $__Rollbar_sMessageSummary - [Optional] A string that will be used as the title of the Item occurrences will be grouped into. Max length 255 characters. If omitted, Rollbar will determine this on the backend. _Rollbar_SendDebug("This is an debug message. If you received this, you were successful!", "Debug Message") _Rollbar_SendInfo("This is a test message. If you received this, you were successful!", "Info Message") _Rollbar_SendWarning("This is an warning message. If you received this, you were successful!", "Warning Message") _Rollbar_SendError("This is an error message. If you received this, you were successful!", "Error Message") _Rollbar_SendCritical("This is an critical message. If you received this, you were successful!", "Critical Message") ; Usable Example Local $sImportantFile = "C:\NOTAREALFILE_1234554321.txt" Switch FileExists($sImportantFile) Case True MsgBox(0, "Example Script", "An important file was found. Continuing...") Case Else _Rollbar_SendCritical('An important file was missing. Halting... File: "' & $sImportantFile & '"', 'Important file "' & $sImportantFile & '" is missing.') EndSwitch Notes: Please comment your feedback, advice, & suggestions below. While this is only a proof of concept, I will expand its feature set for everyone to use. Right now, it is fully functional but not tested in production. Changelog: RollbarSDK.au3 RollbarTest.au3 v0.2 v0.1.1
  7. Im not sure if this is intended but normally Autoit variables are always passed as copies (except objects i think). But below i observed an unconsistency when copying maps with nested maps inside. Issue: If you create a nested map1 and copy it to a new map2, changing a nested value in map2 will also change the nested value in map1 Dim $player[] Dim $sub[] $player.test1 = 1 $player.test2 = $sub $player.test2.child1 = "org" $player.test2.childext = $sub $player.test2.childext.child1 = "org2" $playerold = $player ; make a copy of the whole map ConsoleWrite("player.test2.child1 : "& $player.test2.child1 & @CRLF); original nested value in $player $playerold.test2.child1 = "changed" ; edit a nested value in $playerold ConsoleWrite("player.test2.child1 : "& $player.test2.child1 & @CRLF) ; original nested value in $player changed ConsoleWrite("---------------------" & @CRLF) ConsoleWrite("player.test2.childext.child1 : "& $player.test2.childext.child1 & @CRLF); original level2 nested value in $player $playerold.test2.childext.child1 = "changed2" ; edit a level2 nested value in $playerold ConsoleWrite("player.test2.child1 : "& $player.test2.child1 & @CRLF); original level1 nested value in $player stayed the same ConsoleWrite("player.test2.childext.child1 : "& $player.test2.childext.child1 & @CRLF); original level2 nested value in $player changed
  8. WinSetState ("[CLASS:OpusApp]", "", @SW_SHOWMAXIMIZED) and WinSetState ("[CLASS:OpusApp]", "", @SW_MAXIMIZE) don't maximize the window. Using WinSetState("[CLASS:OpusApp]","",@SW_RESTORE) allows me to maximize it about 15% of the time. I've tried using WinMove("[active]",0,0,@Desktopwidth,@Desktopheight), but that only makes it worse. I've also tried putting in a sleep and maximizing it again. Does anyone have a solution? Here's my code: The startup script is intentionally commented, because I'm not testing it right now. The other comment is just for debugging when I need it. UPDATE: When I run two instances of the program, it works almost all the time, but if I copy the code inside the else statement twice it doesn't work at all (despite the fact that it's running the same code just in one program vs two). I also noticed that when I run two instances of it, about 50% of the time when it opens both the windows, it also hits the windows button and types the letter d into the search box. Neither of these actions are in my code. I'm not really sure what's going on.
  9. _ArrayDisplay($aArray, "Window Title", "1:", 0, Default, "Column") ; Expected results are rows 1 to the end of the array, all columns. The result is rows 0-1, all columns. The API reference is here: https://www.autoitscript.com/autoit3/docs/libfunctions/_ArrayDisplay.htm Am I doing something wrong?
  10. Hello everyone, I discovered a bug yesterday and I posted it at the bug tracker: I also made a simple script which can be used to reproduce the bug: CreateVariable() ConsoleWrite($sGlobalVariable & @CRLF) Func CreateVariable() Global $sGlobalVariable = "Foobar" EndFunc The bug was closed by @BrewManNH: While I partially agree with the above statement, My code was not practical enough... so @mLipok advised me to create a thread on the forums with practical code (Thanks!). That is the point of this thread, I am going to provide the code where I experience this bug/problem . I discovered this bug when I was working on one of my projects called "ProxAllium". When the main script finishes execution, Au3Check throws a nasty warning about "variable possibly used before declaration": As you can see, the variable is indeed being used after calling the function in which the variable is declared... The warning won't appear if I declare the function ABOVE the variable. As @BrewManNH said, Au3Check reads line by line... I think this should be changed, Au3Check should not throw warnings if the interpreter is able to run the code, at least most of the time anyway! So what do you guys think? Is this a valid bug?... and I request those who participate in the discussion not to discuss the code being "poor", that is another thing/thread in itself P.S I had already written this once but the forum editor decided to mess up and when I undid (Ctrl + Z) something... This is a poorly written version of that article, I was very frustrated while writing this!
  11. Hello! I've found some not obvious behaivor of RegDelete() function. So If we already have created registry key 'HKEY_LOCAL_MACHINE\SYSTEM\Test' _without_ 'value' in it. RegDelete() will will raise an Error with code = 1 ( according to documentation 1 means - Unable to open requested key ), instead of code = -2 ( unable to delete requested key/value ). This code running under account without administrative right, will return @error = 1 even if 'HKEY_LOCAL_MACHINE\SYSTEM\Test' already existing key and no 'value' in it. $i_regdelete_result = RegDelete( 'HKEY_LOCAL_MACHINE\SYSTEM\Test' , 'value' ) ; = 2 MsgBox( 0 , 'ERROR' , @error ) ; = 1 Maybe this is due to RegDelete() tries to open target key with write access and gets denied. So I thought that this is not so obvious as it can be. And naturally $i_regdelete_result must have 0 in this scenario ( according to documenatation 0 means Special return value of RegDelete when key/value does not exist )
  12. Hi! I just playing around with _ArrayMin for my next project, but seems like it's not working. I think the code is OK, but I always get the value of $aArray[2][1], not col 2's lowest value (see attached image)
  13. Hi all. Because of me wondering if I could access the key/value pair arrays with the numbers as indexes, I have found out that the zeroth element for some reason doesn't return anything. Here's the example: local $r[2] $r["test1"]="hello" $r["test2"]="how are you" msgbox(64, $r[0], $r[1]) ; prints the ["test2"] but not ["test1"]. Is this even supposed to be a thing? BTW, I haven't seen Autoit get updated since 2015; is it abandened or something? Any help/clarification appreciated.
  14. Hi, I have update to the most recent Autoit version. I have a little problem with _ArrayUnique function. If I have one array with two rows. _ArrayUnique crashes. I haven't any problem if there are more than two rows. I know that seems useless use this function with two rows, but these rows are the result of a search (generally I have more than two rows). "C:\Program Files (x86)\AutoIt3\Include\Array.au3" (2290) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: Local $vFirstElem = ( ($iDims = 1) ? ($aArray[$iBase]) : ($aArray[$iColumn][$iBase]) ) Local $vFirstElem = ( ($iDims = 1) ? ($aArray[$iBase]) : (^ ERROR #include <Array.au3> Dim $Test1[3][6]=[["11","12","13","14","15","16"],["21","22","23","24","25","26"],["21","22","23","24","25","26"]] Dim $Test[2][6]=[["11","12","13","14","15","16"],["21","22","23","24","25","26"]] Dim $result=0 _ArrayDisplay($Test1) _ArrayDisplay(_ArrayUnique($Test1, 2)) _ArrayDisplay($Test) _ArrayDisplay(_ArrayUnique($Test, 2)) I put a workaround that I don't use _ArrayUnique function if there are only two results
  15. Hi All, Could someone please PLEASE tell me what I'm doing wrong here? I feel like I'm close to figuring this out, I think I've identified what is causing the issue. Whenever I try to use the hotkey CTRL+SHIFT+T (or any other letter other than T for that matter) to paste the text to notepad, my CTRL and SHIFT keys are held down *IF* I release them *WHILE* the raw text is being written. It seems to be that if I release the CTRL+SHIFT keys: Before the Send Raw text starts to write to the screen: the CTRL and SHIFT keys ARE NOT held down, this is good During the Send Raw text being written to the screen: the CTRL and SHIFT keys ARE held down perpetually until I physically press them on the keyboard, this is bad After the Send Raw text has written all text to the screen: the CTRL and SHIFT keys ARE NOT held down, this is good This is also the case if I were to use the Windows Key as the hot key instead of the CTRL+SHIFT, I would need to tap the WIN key physically on my keyboard if I released it while the raw tet was being sent to the screen (eg, WIN+T). This issue also happens no matter which program I try to write the text to. Here's some example code: (I've put a bunch of "a's" in there to give enough time to test releasing the CTRL+SHIFT before/during/after the writing of them) HotKeySet("^+t", "WriteTxt") Func WriteTxt() WinWaitActive("Untitled - Notepad") $var = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" send($var, 1) EndFunc While 1 Sleep(500) WEnd Thanks guys!
  16. Hello, I found a bug in the statement "ContinueLoop". Run the following script: For $a = 1 To 3 MsgBox(0, "The value of $a is:", $a) For $i = 1 To 10 MsgBox(0, "The value of $i is:", $i) If $i = 5 Then ContinueLoop 2 Next ; command Next
  17. I added to my project in c# referenced the dll's : AutoitX3.Assembly.dll and AutoitX3Lib.dll In my code i'm trying to simulate a combination of Ctrl + O So I did: AutoIt.AutoItX.ControlSend(processTitle, "", processFileName, "^^{r}"); When using a break point: In processTitle I see: Game In the processFileName I see: C:\Program Files (x86)\Game\Game\Game.exe For checking I looked into Task Manager and there I see in the tab details: Game.exe as name and in Description I see Game And if I will click manually on my own Ctrl + O it will work it will do what I need it will take effect. But when using the AutoIt it will not work will do nothing no effect at all. And I see it's getting and doing the line with the ControlSend but nothing happen. And it did work few hours ago. What is wrong ?
  18. Some of my users are having trouble that I confirmed happens "just for them". Specifically _IEFormElementRadioSelect returns $_IESTATUS_NoMatch for a radio button that clearly exists in the page. For me using WinXP / IE8 or Win8.1 / IE11 I see few if any symptoms, but when I put together a test on their Win 7 / IE8 platform sure enough it breaks. The unit test is just a bit of code that changes a radio box value, which triggers a postback, waits for the postback to complete, and repeats with a new value, triggering another postback, repeat 1000 times and call it success. After some debugging I determined that _IEFormElementGetObjByName was finding the radio button, but _IEFormElementRadioSelect was not, which lead to this bit of code from IE.au3: Local $oItems = Execute("$oObject.elements('" & $sName & "')")Which looks valid and works some (maybe even most) of the time on Win 7 / IE 8. So I modified it to use the similar construct from _IE_FormElementGetObjByName to be: Local $oItems = $oObject.elements.item($sName)Which works 100% for me. So the question now becomes, is this a beta issue, an IE.au3 issue, or an IE issue? The only real difference is where I place my code to workaround cases where Win 7 / IE8 / _IEFormElementRadioSelect don't do what was expected.
  19. Have the following code snippet: If not FileExists($ExchangeDir & $StockCSV) Then _FileWriteFromArray($ExchangeDir & $StockCSV, $YahooStockEntries) Else When trying to do a check against the non-existent file 'PRN.csv', FileExists is evaluating as True. This is not happening with other file names, directory structure is correct. Any ideas? Thanks Chip
  20. Global $i = 3;Assign 3 to variable $i ConsoleWrite("count is:"&$i&@CRLF);It says variable value is 3 If Not $i=45 Then;The bug is here ConsoleWrite("count is:"&$i&@CRLF);This should say count is:3 but it don't because of the bug EndIfThis is a very simplified example of the bug, anyone knows why this happen?
  21. Good day to the autoit community. I am having an issue with the _GUICtrlRichEdit on a pop-up gui box. I have cobbled a short script together that replicates the issue. Simply run the script and click the button for the pop-up gui with the richedit box. If you close the pop-up gui and re-click the button, the richedit box fails to load on subsequent pop-up gui launches. #include <GuiRichEdit.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) $Form1_1 = GUICreate("hubconsole", 655, 697) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1_1Close") $gethubbutton = GUICtrlCreateButton("Get Info", 501, 129, 81, 25) GUICtrlSetOnEvent(-1, "Main") GUISetState(@SW_SHOW) Func Form1_1Close() exit EndFunc While 1 Sleep(100) WEnd Func Main() Local $hGui, $hRichEdit, $iMsg $hGui = GUICreate("Example (" & StringTrimRight(@ScriptName, 4) & ")", 320, 350, -1, -1) global $richgui = $hGui GUISetOnEvent($GUI_EVENT_CLOSE, "Form2_1Close") global $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 220, _ BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) _GUICtrlRichEdit_AppendText($hRichEdit, @CR & "This is more text") GUISetState() EndFunc Func Form2_1Close() _GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes GUIDelete($richgui) EndFunc Some further information from diagnostic: The first cycle around shows no @error's for the deconstructor Form2_1Close().. so the richedit destroy and guidelete both happen. When I click the button for the second launch, I see the pop-up gui has a new HWnd.. example: 1st click (0x00514B6) 2nd click (0x000614B6) on the line " global $hRichEdit = _GUICtrlRichEdit_Create($hGui... " I see value to @error of 1 which isn't detailed in the helpfile of the function, but if I dig into the include I see error 1 gets set when: If Not _WinAPI_IsClassName($hWnd, $_GRE_sRTFClassName) Then Return SetError(1, 0, 0) ; Invalid Window handle for _GUICtrlRichEdit_Create 1st parameter I'm stuck at this point as I can't figure why "_WinAPI_IsClassName($hWnd, $_GRE_sRTFClassName" comes back with a failure on subsequent launches of the popup.
  22. Hey guys... not a vital issue or anything, but I've setup the format of date and time in a user input field (code included below), but the output is off on the second field and I can't figure where it's getting it from.... the code displayed is the only place in the program that modifies these fields: $StartDate = GUICtrlCreateDate(@Year&"/"&@MON&"/"&@MDAY&" "&@HOUR&":00", 8, 112, 138, 21) ; to select a specific default format $DTM_SETFORMAT_ = 0x1032 ; $DTM_SETFORMATW $style = "yyyy/MM/dd HH:mm" GUICtrlSendMsg($StartDate, $DTM_SETFORMAT_, 0, $style) $EndDate = GUICtrlCreateDate(@Year&"/"&@MON&"/"&@MDAY+1&" "&@HOUR&":00", 8, 152, 138, 21) $DTM_SETFORMAT_ = 0x1032 ; $DTM_SETFORMATW $style = "yyyy/MM/dd HH:mm" GUICtrlSendMsg($EndDate, $DTM_SETFORMAT_, 0, $style) The outputs are: Startdate: 2014/04/04 17:00 (good so far) EndDate: 2014/04/05 07:25 (Where did 07:25 come from? FYI 25 is the current Minute time of the test, but the 07Hour is not. Current hour is 17:00) Both fields have almost exactly the same code and syntax with endDate being incrimented by 1. Nowhere else in my script am I making any modifications to either field, just read. Thanks for your help
  23. Small chance i'm too tired to think straight, but I do believe this is a bug. I was reading strings from a file which were 32 bytes in length. Padded with 00's So I thought i'd strip off the exess with StringStripWS. Which docs say can strip CHR(0) as whitespace. Not working, here's a modified from the Example that Duplicates the problem. All whitespace removed exept the Null Char. #include <StringConstants.au3> #include <MsgBoxConstants.au3> ; Strip leading and trailing whitespace as well as the double spaces (or more) in between the words. Local $sString = "Thisisasentencewithwhitespace." & CHR(0) ConsoleWrite(StringLen($sString) & @CRLF) $sString = StringStripWS($sString, $STR_STRIPTRAILING) ConsoleWrite(StringLen($sString) & @CRLF) Prints to console size of the string before and after as 31. No Changes.
  24. With older Autoit Versions my script was working fine and i don´t know how i should change my script to work again... Basically my problem section does nothing more then selecting some menus in SAP then pressing 2 buttons in following popup-windows and the 3rd popup is a file save dialog... My script always stops executing after the 2nd button press (it is pressed, but it won´t get any further....) Connection to SAP is initiated with _SAPSessAttach("") from the SAP UDF but the commands are sent directly via the COM interface to SAP. _SAPSessAttach("") ConsoleWrite("Setze $AnalyseBlatt ..." & @CRLF) $AnalyseBlatt = @ScriptDir & "\test.xls" ConsoleWrite("Lösche $AnalyseBlatt ..." & @CRLF) If FileExists($AnalyseBlatt) Then FileDelete($AnalyseBlatt) EndIf $SAP_Session.findById("wnd[0]/shellcont[0]/shell/shellcont[2]/shell" ).expandNode("1000") $SAP_Session.findById("wnd[0]/shellcont[0]/shell/shellcont[2]/shell" ).selectItem("4000", "COL01") $SAP_Session.findById("wnd[0]/shellcont[0]/shell/shellcont[2]/shell" ).ensureVisibleHorizontalItem("4000", "COL01") $SAP_Session.findById("wnd[0]/shellcont[0]/shell/shellcont[2]/shell" ).topNode = ("0001") $SAP_Session.findById("wnd[0]/shellcont[0]/shell/shellcont[2]/shell" ).doubleClickItem("4000", "COL01") ConsoleWrite("Btn0 Press..." & @CRLF) $SAP_Session.findById("wnd[1]/tbar[0]/btn[0]").press ConsoleWrite("Btn5 Press..." & @CRLF) $SAP_Session.findById("wnd[1]/tbar[0]/btn[5]").press ;--------- SCRIPT STOPS HERE, without any error, it just hangs.... ConsoleWrite("Warte auf Speichern unter Dialog..." & @CRLF) WinWait("Speichern unter") ConsoleWrite("Setze Edit auf Analyseblatt..." & @CRLF) ControlSetText("Speichern unter", "", "[CLASS:Edit; INSTANCE:1]", $AnalyseBlatt) Sleep(2000) ControlClick("Speichern unter", "", "[CLASS:Button; INSTANCE:2]")
  25. I discovered bug in AutoIt. I write here first and not directly on BugTrac to be sure. Here is simple test script: GUICreate("ToolTip bug", 400, 300) GUICtrlCreateLabel('Test1', 10,10,100,25) GUICtrlSetTip(-1,'tip 1') GUICtrlCreateLabel('Test2', 10,50,100,25) GUICtrlSetTip(-1,'tip 2') GUISetState(@SW_SHOW) While 1 If GUIGetMsg() = -3 Then ExitLoop WEnd When you place cursor on label1 and then immediatelly after tooltip appear on label2 and back to label1 all is OK (tooltip appears) but when you place cursor on label1 and don't move cursor until tooltip dissapear (approx 5 seconds depends on Windows setting) then after placing cursor on label2 tooltip appears but back on label1 tooltip don't appear anymore Note1: I tested it on "my latest AutoIt beta" 3.3.7.23 Note2: This bug isn't in AutoIt 3.2.12.1 so it was introduced in some new version So question is if this bug is also in latest AutoIt release/beta version. EDIT: Now I discovered that it can be unblocked by click on label, after that ToolTip shows correctly again This bug apply also for other controls not only labels, tested on buttons EDIT2: It seems bug is only on WinXP, i will do more tests ... EDIT3: YES it appears only on WinXP (also with latest release/beta 3.3.8.1/3.3.9.4). Bug ticket reopened http://www.autoitscript.com/trac/autoit/ticket/1275
×
×
  • Create New...