[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.8.2.2 Use variable to select a task between three

In this example, we will create a variable named `my_var' and three tasks `task1' `task2' and `task3'. The value of `my_var' will be used to control which task will be selected.

We add an `if_equal' condition to each task with rtoa command.

`task1' will be selected if `my_var' value is `V1', `task2' will be selected if `my_var' value is `V2' and `task3' will be selected if `my_var' value is `V3'.

 
$ dio87d -d
$ dio87c va my_var 
$ dio87c ra my_ref
$
$ dio87c rta my_ref task1 
$ dio87c rtoa my_ref task1 add if_equal my_var V1
$ dio87c rta my_ref task2
$ dio87c rtoa my_ref task2 add if_equal my_var V2
$ dio87c rta my_ref task3
$ dio87c rtoa my_ref task2 add if_equal my_var V3
$ 

Now, we change value of `my_var' with `vsv' command and we use rs to simualte referential planification. You can see that `task1' is selected if the value of `my_var' is `V1', that `task2' is selected if value is `V2' and that `task3' is selected if value is `V3' :

 
$ dio87c vsv my_var V1
$ dio87c rs my_ref "2004-03-18"
task1
$
$ dio87c vsv my_var V2 
$ dio87c rs my_ref "2004-03-18"
task2
$ 
$ dio87c vsv my_var V3 
$ dio87c rs my_ref "2004-03-18"
task3
$ 



This document was generated by dom on September, 11 2005 using texi2html