EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: MSI macro setting in substitutions file
From: Ralph Lange <[email protected]>
To: EPICS Tech-Talk <[email protected]>
Date: Fri, 14 Feb 2014 09:54:08 +0100
On 13.02.2014 22:55, Westfall, Michael D wrote:
A question regarding MSI (Macro Substitution and Include) tool:

Is there a way to set the value of a macro in the substitutions file for later use without triggering an immediate substitution?

For example, say I have a template file xxx.template:

    $(FNAME) $(LNAME) is a $(SEX)

and my substitutions file xxx.substitutions:

    file xxx.template {
       pattern {FNAME, LNAME, SEX}
       {John, Smith, Male}
       {George, Jones, Male}
       {James, Taylor, Male}
       {Robert, Redford, Male}
       {Larry, Cableguy, Male}
       {Susan, Williams, Female}
       {Judy, Johnson, Female}
       {Melinda, Martin, Female}
       {Cathy, Lewis, Female}
       {Linda, Hall, Female}
    }

and the output after running "msi -S xxx.substitutions"
John Smith is a Male
    George Jones is a Male
    James Taylor is a Male
    Robert Redford is a Male
    Larry Cableguy is a Male
    Susan Williams is a Female
    Judy Johnson is a Female
    Melinda Martin is a Female
    Cathy Lewis is a Female
    Linda Hall is a Female




What I'd like to do is avoid typing "Male" and "Female" so often (perhaps I have hundreds and hundreds of substitutions to do) by having a substitutions file something like this:


    file xxx.template {
       Set SEX=Male
       pattern {FNAME, LNAME}
       {John, Smith}
       {George, Jones}
       {James, Taylor}
       {Robert, Redford}
       {Larry, Cableguy}
       Set SEX=Female
       {Susan, Williams}
       {Judy, Johnson}
       {Melinda, Martin}
       {Cathy, Lewis}
       {Linda, Hall}
    }

Any tips for doing something like this with the existing tool?

global { SEX=Male }
file xxx.template {
      pattern {FNAME, LNAME}
      {John, Smith}
      {George, Jones}
      {James, Taylor}
      {Robert, Redford}
      {Larry, Cableguy}
}
global { SEX=Female }
file xxx.template {
      pattern {FNAME, LNAME}
      {Susan, Williams}
      {Judy, Johnson}
      {Melinda, Martin}
      {Cathy, Lewis}
      {Linda, Hall}
   }

Cheers,
~Ralph

Replies:
Re: MSI macro setting in substitutions file Andrew Johnson
References:
MSI macro setting in substitutions file Westfall, Michael D

Navigate by Date:
Prev: RE: Binary record that recover its value after changed Antonio Borondo
Next: Job Announcement: Control System Software Architect at European Spallation Source Suzanne Gysin
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: MSI macro setting in substitutions file Ralph Lange
Next: Re: MSI macro setting in substitutions file Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·