var total:int = 1; // create a for() loop for(var i:int=0; i<4; i++) { total *= 2; if(total==8) break; // ends completely this loop trace('i='+ i+ ' - total='+ total); } // Output: i=0 - total=2 i=1 - total=4When the conditional "if(total==8)" returns true, the code after the "break" will not be executed at all, and the execution of this "for()" loop ends.
var total:int = 1; // create a for() loop for(var i:int=0; i<4; i++) { total *= 2; // skip other actions in the current iteration when total==4 or total==8 if(total==4 || total==8) continue; trace('i='+ i+ ' - total='+ total); }The Output is:
"break and "continue" can be used with any loop statement: while(), do..while, for(), for..in, for each..in.
<embed src="flash_game.swf" width="450" height="350" />
#id:first-line { font-weight: bold; color: blue; }
var url = window.location; alert(url);
$homepage = file_get_contents("http://coursesweb.net/"); echo $homepage;