Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: local variable defined outside a do file


From   Mayank Mishra <mayankm16@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: local variable defined outside a do file
Date   Mon, 4 Jul 2011 18:43:19 +0530

Hi all,

This is regarding a problem related to a local variable defined
outside a do file. Following is the code:

foreach x in a b c d {
do dummy.do
save, replace
}

The dummy file uses the local variable x in its calculations and as
you can see it is defined outside the do file. The Stata gives an
error on this.
So, please tell me what can be done in this case.

Thanks and regards,

OM
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index