I agree with Marty on this. If the alternate behaviour is required (forgetting all previous macro definitions), separate dbLoadTemplate commands can be issued, each with its own "file" set.
/Ron Chestnut
-----Original Message-----
From: Marty Kraimer [mailto:[email protected]]
Sent: Wednesday, June 02, 2004 5:23 AM
To: kuner
Cc: [email protected]
Subject: Re: found a bug in 3.13.9 dbLoadTemplate - after all that time
First I want to make sure I understand what you are saying.
If a substitution file contains
file test.template {
{ NAME="X", HOPR="9", LOPR="1"}
}
file test1.template {
{ NAME="Y" }
}
You are saying that any appearences of $(HOPR) or $(LOPR) in test1.template should NOT be expanded.
Both dbLoadTemplate and msi (Macro Substitution and Include) expand
$(HOPR) and $(LOPR) using the last definition they received. Thus in the above they will be expanded using HOPR="9", LOPR="1"
I can see either semantic definition being valid. Since the existing semantics have been in use for many years, it does not seem to be good idea to make a change. Many users may rely on the existing semantics.
Marty Kraimer
kuner wrote:
> Hi,
>
> Consider this templates:
>
> test.template
>
> record(calc,"$(NAME):rdbk") {
> field(DESC,"calculation")
> field(SCAN,".5 second")
> field(CALC,"A")
> field(INPA,"$(NAME):rd .PP.NMS")
> field(HOPR,"$(HOPR)")
> field(LOPR,"$(LOPR)")
> }
>
> test.template
>
> record(ai,"$(NAME):$(SNAME):rd") {
> field(DESC,"position readback")
> field(HOPR,"$(HOPR)")
> field(LOPR,"$(LOPR)")
> }
>
>
> and this substitution file:
>
> file test.template {
> { NAME="X", HOPR="9", LOPR="1"}
> }
> file test1.template {
> { NAME="Y" }
> }
>
> Remark: The substittutions $HOPR and $LOPR are used in both files, but
> in the .substitution files it is forgotten for the second file,
> test1.template.
>
> After the run of make dbloadTemplat will create:
>
> record(calc,"X:rdbk") {
> field(DESC,"calculation")
> field(SCAN,".5 second")
> field(CALC,"A")
> field(INPA,"X:rd .PP.NMS")
> field(HOPR,"9")
> field(LOPR,"1")
> }
> record(ai,"Y:$(SNAME):rd") {
> field(DESC,"position readback")
> field(HOPR,"9")
> field(LOPR,"1")
> }
>
> HOPR and LOPR will be set in both records, so the last defined value
> from the former substituted file will be used for the actual file.
> This is not correct.
>
> Grüssle Bernhard
>
> PS: the work I did when I found this was not such an easy EPICS database.
>
- Replies:
- Re: found a bug in 3.13.9 dbLoadTemplate - after all that time Tim Mooney
- Navigate by Date:
- Prev:
Re: found a bug in 3.13.9 dbLoadTemplate - after all that time kuner
- Next:
Re: found a bug in 3.13.9 dbLoadTemplate - after all that time Tim Mooney
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
<2004>
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: found a bug in 3.13.9 dbLoadTemplate - after all that time Ralph Lange
- Next:
Re: found a bug in 3.13.9 dbLoadTemplate - after all that time Tim Mooney
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
<2004>
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|