Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
<== Date ==> <== Thread ==>

Subject: Re: if-then-else in iocsh
From: Andrew Johnson <anj@aps.anl.gov>
To: Emmanuel Mayssat <emmanuel_mayssat@lynceantech.com>
Cc: tech-talk@aps.anl.gov
Date: Fri, 28 Jan 2005 14:38:15 -0600
Emmanuel Mayssat wrote:
I use "dbLoad" files such as this one:

<snip>


Now, I would like to include in my dbl files a command that says:
If this variable is not set, then set it to this value.

This technique appears to be somewhat fragile (meaning you must be careful if you decide to use it). It's probably fine if you have a small number of .dbl files and can keep track of all the variables that each one needs, but what happens if you should re-use a variable name (with different default values) in two different dbl files? The first dbl file would set the value it wants as the default, but the second file would always see the earlier file's default setting (because the variable was never unset), even if the user really wanted to use the second dbl file's default. Swapping the order in which you execute the two dbl files would change what is loaded into the database!


I would suggest that you require that the parent script must set *all* parameters that a dbl file relies on itself, or load a single default settings file early on like Eric suggested.

- Andrew
--
Dear God, I didn't think orange went with purple until I saw
the sunset you made last night.  That was really cool. - Caro

Replies:
Re: if-then-else in iocsh Maren Purves
Re: if-then-else in iocsh Emmanuel Mayssat
mbbo strings linked to mbbo commands Emmanuel Mayssat
References:
if-then-else in iocsh Emmanuel Mayssat
Re: if-then-else in iocsh Andrew Johnson
Re: if-then-else in iocsh Maren Purves
Re: if-then-else in iocsh Emmanuel Mayssat

Navigate by Date:
Prev: Re: if-then-else in iocsh Eric Norum
Next: Re: if-then-else in iocsh Maren Purves
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
Navigate by Thread:
Prev: Re: if-then-else in iocsh Emmanuel Mayssat
Next: Re: if-then-else in iocsh Maren Purves
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·