Ending a for loop without using "||" in the condition

how can i exit a for loop without using an OR logic test in the condition
when i try this, it comes up saying “this movie is running a script that is causing the computer to run slowly etc… stop script?” - or something to that effect.

thanks

cA

You’d use the [font=courier new]break[/font] statement. What’s your code?

hm, my computer crashed. i hate it when that happens, can’t be bothered repeating work. thanks anyway, i’ll remember that break.

one question though:
would:

for(init;condition; next) {
if (test) {
break;
}
}

would that exit the if statement or the for loop?

The [font=courier new]for[/font] statement. The [font=courier new]break[/font] statement will only stop [font=courier new]for[/font], [font=courier new]for…in[/font], [font=courier new]do while[/font] or [font=courier new]while[/font], and [font=courier new]switch[/font].

k, thanx :thumb: