Register on the forum now to remove ALL ads + popups + get access to tons of hidden content for members only!

Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > ASP

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 01-09-2017, 04:44 AM   #1
chinmay.sahoo
Registered User
 
Join Date: Dec 2013
Location: Banglore
Posts: 335
Send a message via AIM to chinmay.sahoo Send a message via MSN to chinmay.sahoo
Break and continue

The standard way to get out of a looping structure is for the main test condition to become false. The special commands break and continue offer an optional side exit from all the looping constructs, including while, do-while, and for:

✦ The break command exits the innermost loop construct that contains it.
✦ The continue command skips to the end of the current iteration of the innermost loop that contains it.

For example, the following code:


Code:
for ($x = 1; $x < 10; $x++)
{
// if $x is odd, break out
if ($x % 2 != 0)
break;
print(“$x “);
}

prints nothing, because 1 is odd, which terminates the for loop immediately. On the other hand, the code:



Fat Cutter Powder | Asthi jivak | Fat Cutter
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
chinmay.sahoo is offline   Reply With Quote

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:29 AM.


Powered by vBulletin Copyright © 2013 vBulletin Solutions, Inc.