Sign in to follow this  
Followers 0
Floppy

Error in AutoIt Help?

3 posts in this topic

#1 ·  Posted (edited)

Hello,

Look this: http://www.autoitscript.com/autoit3/docs/k...ds/ExitLoop.htm

The Help says that I can put the number of loop to exit.

But why doesn't this script work?

#include <GUIConstantsEx.au3>

GUICreate("My GUI") 
    GUISetState(@SW_SHOW) 


    While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop[2]
    WEnd

Error:

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\......\Desktop\PowerEr\exit.au3"    
C:\Users\......\Desktop\PowerEr\exit.au3 (9) : ==> Error in expression.:
If $msg = $GUI_EVENT_CLOSE Then ExitLoop[2]
If $msg = $GUI_EVENT_CLOSE Then ExitLoop ^ ERROR
>Exit code: 1   Time: 0.225

bye

Edited by FSoft

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Wrong syntax ... plus only one loop :P....

#include <GUIConstantsEx.au3>

GUICreate("My GUI")
GUISetState(@SW_SHOW)

While 1
    While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop 2
    WEnd
WEnd

The square brackets in the help-file indicate that the value is optional...

ExitLoop(2)

also works

Edited by KaFu

Share this post


Link to post
Share on other sites

looooooool :P:unsure::D:D

Thank you

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