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: RE: AW: RE: RE: variable labels and reshape--reinserting en masse


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: AW: RE: RE: variable labels and reshape--reinserting en masse
Date   Mon, 19 Apr 2010 19:33:51 +0200

<>

" I'll do my best to wean myself off of it, but it will take some time!"



Stata proudly maintains backward compatibility: Under -version- control, you
should be able to use this syntax for a long time, if you want to...



HTH
Martin

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Hewan Belay
Sent: Montag, 19. April 2010 18:48
To: [email protected]
Subject: Re: st: RE: AW: RE: RE: variable labels and reshape--reinserting en
masse

Dear Martin,

Excellent, your fix of my command worked. Two main lessons learned: I placed
two `' brackets next to each other instead of nesting them, i.e. I did
`myvarlab_'`y' instead of doing `myvarlab_`y''. Second, I shouldn't have
used -for any- and instead should have used -foreach ... in-. In fact, I
didn't know that -for- was dead (thanks Nick for bringing me 7 years into
the present!) -for any- has been my workhorse since I started using stata.
I'll do my best to wean myself off of it, but it will take some time!

Thanks all,
Hewan 

--- On Mon, 4/19/10, Nick Cox <[email protected]> wrote:

> From: Nick Cox <[email protected]>
> Subject: st: RE: AW: RE: RE: variable labels and reshape--reinserting en
masse
> To: [email protected]
> Date: Monday, April 19, 2010, 3:20 PM
> I guess that is never going to
> happen. 
> 
> I don't know if you were using Stata around 2000, but no
> end of messes
> followed people's misunderstanding of how local macros
> worked with
> -for-. 
> 
> One-line loops and macros really don't mix in the way that
> many users
> would want because local macros are necessarily interpreted
> before
> execution. My FAQ explains in more detail: 
> 
> Stata 7: Why do I get puzzling results with the for command
> and local or
> global macros?
> http://www.stata.com/support/faqs/lang/macros.html
> 
> Nick 
> [email protected]
> 
> 
> [email protected]
> 
> I personal think that the idea of one-liner-loops including
> parallel
> lists is still a good one. 
> A successor that overcomes some of the limitations
> discussed be???e and
> uses locals instead of capital letters
> would be a nice addition to the Stata toolbox.
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/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/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/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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