[SDL Forum Society - Logo] Tutorial on SDL-88
Belina, Hogrefe (edits Reed)

3.3 Decisions

Back Home Up Next

The values of variables can be used to control a transition. Sometimes it is necessary to specify different actions depending on the value of some variable. This is done in SDL by using the decision construct. Figure 13 shows an example in SDL/GR of the decision construct. Depending on the value of the variable Counter, the process will perform a transition from S1 to S2 (value is less than 3), or to S3 (otherwise).

Use of the decision

Figure 13: Use of the decision
Note: A fragment of an SDL-88 process diagram.

In the decision symbol (a diamond with a number of paths for results) a question is asked. The question may have various answers, but when interpreting the decision, one and only one answer should be correct. To guarantee that one answer is always correct, the ELSE answer can be used. The decision symbol may have a number of different shapes. Some examples are given in figure 14.

Decision examples

Figure 14: Further examples decision symbols

Back Home Up Next

Contact the webmaster with questions or comments about this web site.
Copyright © 1997-May, 2013 SDL Forum Society