Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: foreach and globals and {.}

From   "David Harrison" <>
To   <>
Subject   RE: st: foreach and globals and {.}
Date   Mon, 11 Apr 2005 13:03:25 +0100

Another alternative way around the problem would be...

foreach x in `="${out_`year'}"' {

Personally I still prefer the -foreach x of global g-, which also runs quicker than -foreach x in $g-.


-----Original Message-----
From: Michael Blasnik []
Sent: 11 April 2005 12:47
Subject: Re: st: foreach and globals and {.}

woops, I forgot about that requirement.  You can also put the global into a 
local before using it (which may be helpful in other situations):

local outyear ${out_`year'}
foreach x in `outyear' {

Michael Blasnik

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index