AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Goto Error

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
BMP



Joined: 07 Feb 2005
Posts: 14
Location: Germany

PostPosted: Tue Feb 08, 2005 9:17 am    Post subject: Goto Error Reply with quote

I become a Error :

" a Goto/Gosub/GroupActivate mustnt jump into a block that doesent enclose it"

I become this error when i make this code:

Code:
IfWinExist, ahk_class Sim
{
sleep 12000
gosub PRUEFEN
}
else
ENDE:
...More Code


When i make a sleep 1 after else the Code works great....
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Tue Feb 08, 2005 2:44 pm    Post subject: Reply with quote

The label ENDE does not belong to the Else because labels aren't commands. You should instead enclose all the command that belong to the else in a block:
Code:
else
{
    command1
    command2
    etc.
}

Also, it's usually best to avoid having labels inside of blocks.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group