Experimental Physics and
| |||||||||||||||||
|
Actually that was one of my earlier suggestions. but what I really want to do is an if then else in iocsh You're welcome to try to add an if-then-else command to your own version of iocsh, since EPICS is Open Source. However we're not likely to accept any patches that implement this into the official release because we don't want the iocsh to become Yet Another Programming Language. Eric Norum has in the past linked the tcl language up to EPICS so you can write startup scripts in tcl if you want to do intelligent processing in them, although his code was never published. My point was that setting a default in the way you're suggesting could very easily cause you problems, whether you add an if-then-else construct to iocsh or write a defaultEnv(variable, value) command. Imagine two dbload files with this pseudocode: a.dbl: if unset(X) then X=1 dbLoadRecords a.db, X=${X} b.dbl: if unset(X) then X=2 dbLoadRecords b.db, X=${X} If we execute these in this order with X unset: < a.dbl < b.dbl the dbLoadRecords commands will expand out to this: dbLoadRecords a.db, X=1 dbLoadRecords b.db, X=1 whereas if we execute them in the reverse order: < b.dbl < a.dbl they will expand out to this: dbLoadRecords b.db, X=2 dbLoadRecords a.db, X=2 I'm just warning you to be prepared for this to happen. - 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 · |