Jump to content

Search the Community

Showing results for tags 'exitloop'.

  • 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

Found 6 results

  1. Hi I want it to search for a specific color in certain area then excute the loop which presses ESC button and stop the loop when the color no longer present in that specific area. Here is the example of my code. But it doesnt stop when color is disappeared. Pixelsearch(511, 455, 678, 501, 0xFFFFFF) If Not @Error Then While 1 Sleep(1000) Send("{ESC}") Pixelsearch(511, 455, 678, 501, 0xFFFFFF) If @Error Then Exitloop
  2. Hi everyone! I'm developing small testing tool for new software in my company. Tool itself is working correctly (it follows scripted test commands one by one), but I'm trying to develop an error checking function. Mechanics are simple: every time software (external) shows specific error (via window class), program asks for next step. Continue, or abort test (and return to main GUI)? The error check function is switched on/off via Checkbox in GUI. Here are some code fragments: Checkbox: Global $idCheckbox1 = GUICtrlCreateCheckbox("Enable TP.net error handling", 352, 40, 249, 17) GUICtrlSetFont(-1, 12, 400, 0, "Calibri") GUICtrlSetColor(-1, 0x000000) Checkbox switch: GUISetState(@SW_SHOW) Local $Choosen While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idCheckbox1 If _IsChecked($idCheckbox1) Then $cSwitch1 = 1 Else $cSwitch1 = 0 EndIf Case $idAddTest (and so on...) Function call: (alot of ElseIf commands...) ElseIf $aItem = $idOperatorIn Then WywolanieOkna() WinActivate($hFSO) ControlClick($hFSO, "", "[NAME:lblCashierNumber]") Sleep($Sleep_05) Send("0000019{Enter}19{Enter 2}") Sleep($Sleep_75) EndIf #EndRegion ### START ELSEIF ARMY ### Next If $cSwitch1 = 1 Then MsgBox( 0, "Error check!", "Error check ON!") /// just for testing purposes CheckError() Else Return EndIf EndSwitch WEnd Classic _IsChecked function: Func _IsChecked($idControlID) Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked And Checkerror() function itself: Func CheckError() Local $Answer If ControlCommand($hMsgPanel, "", "[NAME:panelMsgBox]", "IsEnabled", "") Then ;~ Sleep($Sleep_05) $Answer = MsgBox(52, "Error!", "An error occured! Continue testing?") ;~ Sleep($Sleep_05) Switch $Answer Case 6 MsgBox(0, "Error!", "Test will now continue.", 3) Send("{Enter}") WinActivate($hWnd) Return Case 7 MsgBox(64, "Error!", "Test cancelled.", 5) $ElseIfArmyOff = 1 ControlClick($hMsgPanel, "", "[NAME:cmdOK]") WinActivate($AppName) #cs MsgBox( 0, "test1", $idTSList) Local $idTSListCopy For $i = 0 to _GUICtrlListView_GetItemCount($idTSList) - 1\ #ce $idTSListCopy = _GUICtrlListView_GetItemTextString($idTestCaseList, $LoopCount) ExitLoop EndSwitch EndIf Return 1 EndFunc ;==>CheckError Problem is: i can't make this function (CheckError() ) return to main gui state, that means: break the If/ElseIf loop. The switch is working correctly (MsgBox on error shows only when it's activated). Checkerror() function works correctly - recognizes the error, stops script until decision is made. But it doesn't terminate If/ElseIf loop. Any help appreciated!
  3. Good morning, I have a question for experts. When I go to a sub form, with Case $GUI_EVENT_CLOSE GUIDelete ($Form2) ExitLoop to return to the main form the variables that I acquired with GUICtrlCreateInput GUICtrlCreateCombo They are automatically reset or is their content? Thank you
  4. Good Morning AutoIT Gurus and Masters Slightly complicated array here... and infinite loop that I'm trying to output to a file after the values are matched up; then anything that doesn't match is deleted from the array and finally written to a file... This guy does an infinite loop... and I'm not sure why... I tried to put in message boxes - but there are 20K records so I couldn't click through that many. LOL. #RequireAdmin #include <array.au3> #include <file.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> Global $WXYZArray01, $array01, $ProgramTitle, $sleeptime, $k01 $ProgramTitle = "Testing 1 2 3" $sleeptime = 1000 _FileReadToArray(@ScriptDir & "\" & "testing_output_csv_unique_values.csv", $array01, "", ",") ;_ArrayDisplay ($array01, "Array01") $aUniqueHostname = _ArrayUnique ($array01, 1) ;_ArrayDisplay ($aUniqueHostname, "UniqueHostname ") For $i01 = Ubound($aUniqueHostname) - 1 to 0 Step - 1 For $j01 = Ubound($array01) - 1 to 0 Step - 1 If $array01[$j01][1] == $aUniqueHostname[$i01] and StringRegExp($array01[$j01][5], "MY_VALUE") then MsgBox(0, "Computer and MY_VALUE", $aUniqueHostname[$i01] & " : " & $array01[$j01][5]) $FileName01 = @ScriptDir & "\" & $array01[$j01][3] & "_" & $aUniqueHostname[$i01] & "_" & $array01[$j01][2] & ".csv" MsgBox(0, "File Name", $FileName01) $WXYZArray01 = $array01 _ArrayDisplay ($WXYZArray01, "WXYZ Array") SplashTextOn($ProgramTitle, 'Generic - Please wait for loop to complete...', 400, 40, -1, -1, 2, "", 10) Sleep ($sleeptime) For $k01 = 0 To Ubound($WXYZArray01) - 1 ; MsgBox (0, "In the WXYZ loop", $WXYZArray01[$k01][1] & " : " & $aUniqueHostname[$i01]) If $WXYZArray01[$k01][1] <> $aUniqueHostname[$i01] Then ;MsgBox (0, "In the WXYZ loop - Delete", $WXYZArray01[$k01][1] & " : " & $aUniqueHostname[$i01]) _ArrayDelete($WXYZArray01, $k01) ;_ArrayDisplay ($WXYZArray01) $k01 -= 1 EndIf If $k01 = UBound($WXYZArray01) - 1 Then ExitLoop Next SplashOff() MsgBox (0, "Out of the WXYZ loop", "Out of the WXYZ loop - File Write From Array") _FileWriteFromArray($FileName01, $WXYZArray01, 1) ExitLoop EndIf Next Next I'm hoping someone here can tell me why at a glance... I'm a little burned out to see the answer... feeling toasty LOL Thank you everyone for your help!
  5. Hello everyone, Have a tricky question: How i manage to exit from loop, but not from script? (ExitLoop it is ok, but runned out of ways, how to use it in my script ) With this i have a problem: If i unpause (F2) the script, it will continue the loop. While scrip is paused (F2) i can restart it (F1), but: While script is paused (F2), and i open my form (F3), and try to press button on it, it will not work, cause active loop is paused at background. (I hope i understand right the method) #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("{F1}", "RunScript") HotKeySet("{F2}", "Pause") HotKeySet("{F3}", "OpenForm") Global $Pause $GUI_Create_Form = GUICreate("Settings", 175, 95) $Button_Save = GUICtrlCreateButton("Save", 10, 60, 75, 25) $Button_Cancel = GUICtrlCreateButton("Cancel", 90, 60, 75, 25) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Button_Save MsgBox(0, "Notification", "Settings have been saved!", 1) GUISetState(@SW_HIDE) Case $Button_Cancel GUISetState(@SW_HIDE) EndSwitch WEnd Func RunScript() Local $Numbers = 1 While 1 $Numbers = $Numbers + 1 Sleep(250) ToolTip("Numbers:" & $Numbers, 0, 0) WEnd EndFunc ;==>RunScript Func Pause() $Pause = Not $Pause While $Pause Sleep(100) ToolTip('Scrpit is "Paused"', 0, 0) WEnd ToolTip("", 0, 0) EndFunc ;==>Pause Func OpenForm() GUISetState() EndFunc ;==>OpenForm All i want is, brake the counter loop with hotkey. Can anyone help me to give a logical answare? (I do need the form with buttons, to store data / save settings)
  6. Hi, i have a for and can't stop it, using ExitLoop i don't see any reaction.. For $oLink in $oLinks $check = _StringBetween($oLink.href, $x1, $y1) If not @error Then $string=_ArrayToString($check) If $a = $string Then ExitLoop ; ==> HERE NEED TO STOP ElseIf $a < 9 Then $result = StringLeft($string, 1) Else $result = StringLeft($string, 2) EndIf EndIf Next ; ==> HERE need to go, by ignoring all rest of $oLinks Thanks alot
×
×
  • Create New...