Experimental Physics and
| |||||||||||||||||
|
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
| ||||||||||||||||
ANJ, 02 Sep 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |