Sign in to follow this  
Followers 0
Smigacznr1

Unexpected exit from loop

3 posts in this topic

Could somebody tell me why script is exiting from loop if it in var $clipboard have string:

%prg%1%

For $i=0 To 1 Step +1
    Sleep(2000)
    Send("{CTRLDOWN}c{CTRLUP}")
    $clipboard = _ClipBoard_GetData($CF_TEXT)
;   $string_with_error = StringInStr($clipboard, "%err%FAILED at ", 1, 1)
    If $clipboard == "Canceled" Then
;       MsgBox(0, '', "cos")
        ExitLoop
    ElseIf $clipboard == "Completed" Then
        ExitLoop
    ElseIf StringInStr($clipboard, "%err%FAILED at ", 1, 1) > 0 Then
        ExitLoop
    Elseif StringInStr($clipboard, "%prg%", 1, 1) > 0 Then
        $i=0
        ContinueLoop(2)
    Else
        $i=0
        ContinueLoop(2)
    EndIf
Next
BlockInput(0)
WinClose("VMware vCenter Converter Standalone")
Exit

I checked clipboard. Pasted to notepad and I saw:

%prg%1%
What is going on?

Share this post


Link to post
Share on other sites



ContinueLoop (2)

"ExitLoop/ContinueLoop" statements only valid from inside a For/Do/While loop

The level 2 of the loop to restart doesn't exist here...

If i remove "(2)" , script is not exiting with %prg%1% in clipboard.


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

ContinueLoop (2)

"ExitLoop/ContinueLoop" statements only valid from inside a For/Do/While loop

The level 2 of the loop to restart doesn't exist here...

If i remove "(2)" , script is not exiting with %prg%1% in clipboard.

Hmm... I can swear that I checked without (2) before.... Strange. Anyway, many thanks! :)

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
Sign in to follow this  
Followers 0