Previous Example-|-Next Example-|-Return to Chapter Listing
Example 6.18:
Breaking Out of Loops--break
The button calls function1(), which uses a 'for' loop. This displays the contents of the counter variable ( i ) in a confirm dialog box. Clicking on OK continues the loop, clicking on Cancel executes the break and ends the loop:
This is the script we used:
Previous Example-|-Next Example-|-Return to Chapter Listing