Jump to content
Shravani

Exit while loop

Recommended Posts

Shravani

Hi Iam new to programming, could some one help me in exiting the while loop for below script that would be grateful.

 

 

HandleProcessSettingWindows()

Func HandleProcessSettingWindows()
  
    While 1
        ; Retrieve a list of window handles.
        Local $aList = WinList()
        ; Loop through the array displaying only visable windows with a title.
            For $i = 1 To $aList[0][0]
                $hWnd = $aList[$i][1]

            If Not $iLoop Then ExitLoop
                WinGetTitle($hWnd) = "Geometry Processing Options"
                ConsoleWrite("Geometry" & @CRLF)
                ControlFocus("Geometry Processing Options", "&OK", "Button5")
                ControlClick("Geometry Processing Options", "&OK", "Button5")

            ElseIf WinGetTitle($hWnd) = "ROMDAS Laser Profilometer Processing Options" Then
                ConsoleWrite("Laser Profilometer" & @CRLF)
                ControlFocus("ROMDAS Laser Profilometer Processing Options", "&OK", "Button5")
                ControlClick("ROMDAS Laser Profilometer Processing Options", "&OK", "Button5")

            ElseIf WinGetTitle($hWnd) = "GPS Processing Options" Then
                ControlFocus("GPS Processing Options", "Start", "Button1")
                ControlClick("GPS Processing Options", "Start", "Button1")

            ElseIf WinGetTitle($hWnd) = "TPL Processing Options" Then
                ControlFocus("TPL Processing Options", "Start", "Button5")
                ControlClick("TPL Processing Options", "Start", "Button5")

                ;Exit
            EndIf
;Exit
            Next

        WEnd
    Exit
EndFunc   ;==>HandleProcessSettingWindows

Share this post


Link to post
Share on other sites
Shravani

Hi thankyou for your reply i used exit loop but when i use, the code executes only once, i want to execute once all the windows are clicked then i want to exit from the script.

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×