| View previous topic :: View next topic |
| Author |
Message |
BMP
Joined: 07 Feb 2005 Posts: 14 Location: Germany
|
Posted: Tue Feb 08, 2005 9:17 am Post subject: Goto Error |
|
|
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 |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Tue Feb 08, 2005 2:44 pm Post subject: |
|
|
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 |
|
 |
|