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]
st: Problem with temporary variable and macro suffix
From 
 
Thomas Lux <[email protected]> 
To 
 
"[email protected]" <[email protected]> 
Subject 
 
st: Problem with temporary variable and macro suffix 
Date 
 
Thu, 29 Aug 2013 17:21:25 +0100 (BST) 
I have a little problem with temporary variables in my program.
I want to create temporary variables with some foreach-elements as a suffix.
I did:
        foreach a in element1 element2 element3 {
            tempvar new`a'
            gen `new`a'' = .
        }
But this does not work. 
I there any other way to do it?
Best,
Thomas
*
*   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/