Introduction to the CSD - Selection

The selection statement usually comes in four basic flavours: the if statement, the if..else statement, the if..elsif statement, and the case statement. The CSD notation for each of these is illustrated below. Note that the connotation of each CSD selection construct is identical.

The True/False condition itself is marked with a small diamond, just as in a flow chart. The statements to be executed if the condition is true are marked by a solid line leading from the right of the decision diamond. The control path for a false condition is marked with a dotted line leading from the bottom of the diamond to the next executable statement, either another decision diamond, an else clause, an others clause, or the end of the decision statement.

Another type of selection statement which is associated with Ada tasking is the select statement, which is illustrated below. Its representation varies slightly from the other selection representations. Note that the conditions themselves are marked with the standard decision diamond. However, the various pieces of the select are separated using a small open circle, giving a slightly clearer representation to the selection choices.


Prev Page | Next Page

Return to GRASP Documentation Page