Flow Control and Iteration
September 29th, 2008 | by Drew |
Image Source:theopensourcery.com
Flow control and iteration are two useful features in most programming languages. Without them, programs would be linear.Flow control means exactly what it sounds like. Control the flow. When using flow control, you are regulating the order in which the code is executed, the number of times it is to be executed or if it is executed at all. Flow control can be classified into three primary categories.
- Conditionals – specifies whether or not to run a selected piece of code based on some conditions.
- Iteration – also known as looping, it specifies that a piece of code be run a number of times.
- Functions – allows you to create named blocks of code to be called by name in the script. This runs a piece of code multiple times from multiple places in the script.
Sorry, comments for this entry are closed at this time.