Question:
In our graph we want to choose between one of two paths of calculations. How do we direct the data flow?
 
Answer:
Graph variables can be used to direct data flow. The technique is to use these variables to conditionally instantiate different boxes in the graph.
The following is presented as an example. It uses two instantiations of the hierarchical box "
conditional" whose contents are selected for execution by setting the variable "Cond". This graph can be found in appnotes/conditional/cond_test.

Figure 1. Top level "cond_test" flow graph.

In this box the input "Cond" is equal to 1.
|
Conditional check |
Result |
Range |
|
Cond==1?0:-1 |
Cond == 0 |
range i = 0..0 |
|
Cond==1?-1:0 |
Cond == -1 |
range j = 0..-1 |
The range
i spans a single value and any expression using it is evaluated. Families defined with this range are instantiated. The range j spans no values and any expression using it is either not evaluated or left uninstantiated.

In this box the input "Cond" is equal to 0.
|
Conditional check |
Result |
Range |
|
Cond==1?0:-1 |
Cond == -1 |
range i = 0..-1 |
|
Cond==1?-1:0 |
Cond == 0 |
range j = 0..0 |
The range
j spans a single value and any expression using it is evaluated, families defined with this range are instantiated. The range i spans no values and any expression using it is either not evaluated or left uninstantiated.
Application Note last updated 3/24/98