|
-
June 20th, 2007, 10:52 AM
#1
Forceing a for-loop to exit
I searched around and couldn't find anything on the subject.
My code looks a little like this ....
Code:
for(int i = 0; i < array->count; i++)
{
if(some condition)
{
do stuff // Activate a tool tip
(this is where I want to force the for loop to exit)
}
else
{
do other stuff // deActivate a tool tip
}
}
The problem is after the tool tip is activated in the if statement, if the for loop runs again then it is deActivated in the else statement.
So what I want to be able to do is exit out of the for loop inside of the if statement.
-
June 20th, 2007, 10:56 AM
#2
Re: Forceing a for-loop to exit
use the break statement.
search: loops break continue
-
June 20th, 2007, 11:02 AM
#3
Re: Forceing a for-loop to exit
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|