ASP.NET Basics, Part 4: Looping the Loop - End of Play
(Page 7 of 7 )
That's about it for this article. Over the last few pages, I listedthe different types of loops available to C# programmers, and showed youhow they can be used. I started with the "while" loop, used to repeat aset of statements until a given condition becomes false. Its closecousin, the "do-while" loop, is used to ensure that a "while" loopexecutes at least once, regardless of the state of the conditionalexpression.
For situations which don't involve as much uncertainly about the totalnumber of loop iterations, there's the "for" loop, useful when you knowthe exact number of iterations the loop should run for. Finally, Idemonstrated the "break" and "continue" keywords, which come in handy toexit a loop and skip over particular iterations of the loop,respectively.
That's about all the time we have for this week. Next week, I shallintroduce you the wonderful world of complex variables - arrays,enumerations and structures - that build on the simple variables you'veencountered thus far to allow more complex storage and manipulation of
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |