Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

While loop, Y or N answer...

Status
Not open for further replies.

MarkLaz

Technical User
May 20, 2005
12
GB
while (ReadyCheck(hSmx) == aCount);

can I do this? I want the program flow to halt, repeatedly calling ReadyCheck() until it returns a value equal to aCount, ie, same functionality as:

while (true)
{
i = ReadyCheck(hSmx);
if (i == aCount)
break;
}

I ask because I want to keep my code clean (this fragment above looks horrible. Thankyou!
 
Then you should use

Code:
while (ReadyCheck(hSmx) != aCount);

Cheers,

Dian
 
To clarify that nothing is done in the loop you can clarify that by having an empty block section {}

/Per
[sub]
www.perfnurt.se[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top