Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Words surrounded with single quotes in a local macro


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Words surrounded with single quotes in a local macro
Date   Wed, 15 Jan 2014 12:52:33 +0000

You can help yourself debug this by showing us the value of `tempo2'
and explaining what "Do[es] NOT Work" means precisely.

Nick
[email protected]


On 15 January 2014 12:30, Tomas Lind <[email protected]> wrote:
> Hi all,
>
> I´m setting up number of tempfiles named tf1, tf2, tf3 . . .  .
>
> First I create the names and put them into a macro called tempo.  That works fine.
>
> The problem is with the second makro, temp2, where I try to store the names `tf1&#8217;  `tf2&#8217;  `tf3&#8217; . . . enclosed in quotes to be able to use them in an append statement.
>
> I want the append statement to look like this:
> append `tf1' `tf2' `tf3' . . .
>
>
> forvalues  i = 1/`Number'  {            // This many tempfiles
> local  tempo   `tempo'    tf`i'    //  named  tf1, tf2, tf3 . . . okey
> local  tempo2  `tempo2'  `"`tf`i''"'    // `tf1&#8217;  `tf2&#8217;  `tf3&#8217; . . .  Do NOT work
> }
>
> tempfile `tempo'                              // works fine
>
>
> Loop that runs several regressions and store
> each result in a tempfile
>
>
> append using "`tempo2'"              // Do NOT work
>
>
>
>
> Anyone have a solution on this?
>
> I´m running Stata 13.1 on a PC
>
> Yours
> Tomas
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index