34,333
edits
Changes
→Breaking Out of a for Loop
== Breaking Out of a for Loop ==
<google>IOSBOX</google>
Having created a loop it is possible that under certain conditions you might want to break out of the loop before the completion criteria have been met (particularly if you have created an infinite loop). One such example might involve continually checking for activity on a network socket. Once activity has been detected it will be necessary to break out of the monitoring loop and perform some other task.