Using the break statement (like Delphis <Exit>) to exit a script, dosn't work anymore. I got an Compile error.... Break used without content.
Like calling a testscript.
if (var1=1) and (var2=0)
{
break;
}
if (....)
{
break;
}
...
...
other scriptcode...
Another way to solve this problem ?
regards
Piwi
break; Not working
Started by Piwi, May 02 2012 08:14 PM
4 replies to this topic
#1
Posted 02 May 2012 - 08:14 PM
#2
Posted 02 May 2012 - 08:45 PM
break exits from loops and switch-case. exit exits a script.
edit: Though, I suppose break should probably work...
edit: Though, I suppose break should probably work...
Edited by GStick, 02 May 2012 - 08:46 PM.
#3
Posted 02 May 2012 - 08:46 PM
If you want to end a script use 'exit;' not 'break'
'break' is for pausing loop functions.
'break' is for pausing loop functions.
#4
Posted 03 May 2012 - 04:47 AM
Thanks guys.
I tranfered old GM-Scripts to Gamemaker Studio. Till GM 8.1 <break> worked like <Exit> outside the statements.
The Help from Gamemaker studio (And GM 8.1).
The break statement has the form
break
If used within a for-loop, a while-loop, a repeat-loop, a switch statement, or a with statement, it end this loop or statement. If used outside such a statement it ends the program (not the game).
I tranfered old GM-Scripts to Gamemaker Studio. Till GM 8.1 <break> worked like <Exit> outside the statements.
The Help from Gamemaker studio (And GM 8.1).
The break statement has the form
break
If used within a for-loop, a while-loop, a repeat-loop, a switch statement, or a with statement, it end this loop or statement. If used outside such a statement it ends the program (not the game).
#5
Posted 03 May 2012 - 05:53 AM
Yeah, I realized that after I posted. That's why I edited my post so shortly after I posted.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











