|


Hello, visitor.
|
Loops
Loops are one of the most important parts of the flowchart that makes it so effective. Loops are, in simplest terms, repetition of steps. It is most often used in conjunction with a decision box. Therefore without loops, flowcharts would in a way merely be a repetition of the pseudocode. In other words, there would be no simplification.
An example of the concept of the loop is the reduction of x+y+x+y into 2(x+y). For example, 2+3+2+3+2+3+2+3 is basically repeating the instructions, 2+3, four times, thus 4(2+3). However, 4(2+3) clearly uses less steps, and when needed, changing the value of the repeated numbers is also much easier.
Here are two basic examples to show the effectiveness of loops.

As you can see from the example, the flowchart with the use of loops is clearly simpler to visualize. Especially when a flowchart includes the repetition of a sequence of steps many times, a single loop will be able to save a significant amount of instructions, while still remains easy to adjust and modify. This is what's called a controlled loop, which is different from the first example as that was an uncontrolled loop, in which the steps that are being looped will indefinitely repeat.
Controlled Loops
A controlled loop uses some sort of method to terminate the loop at a given condition. There are two types of controlled loops: the Do While loop, and the Repeat Until. Before we get to the visual part of each controlled loop, let’s first understand the concept of each loop. First of all, both controlled loops utilize the decision box. The Do While loop places a condition (namely a decision box) right before a statement is executed. This condition usually produces a true/false result that dictates whether a series of instructions inside the loop is repeated. The Repeat Until loop is rather self-explanatory. You basically repeat a loop, until a given condition. For example, you can tell a loop to stop after repeating itself, say, 5 times.
 
Automatic Loop Control
Very often we use the Repeat Until loop (which involves counting) in our flowcharts. This is why the Automatic Loop Control was made. It is basically a single block that includes all the parts of a Repeat Until loop. This can be best shown with the example below:

As you can see, the three parts (COUNT=1, COUNT <=10?, and COUNT=COUNT+1, which are Initialization, Test, and Incrementation, respectively.) are included in a single block that is divided into three triangles. In large-sized flowcharts, the Automatic Loop Control box is a lifesaver, and can be used repeatedly, and further improving the flowchart's clean interface and its simplicity.
|