Statalist


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

st: Passing a local variable into a subsequent do-file


From   Bryce Mason <bmason5@lmu.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Passing a local variable into a subsequent do-file
Date   Wed, 12 Aug 2009 16:22:47 -0700

Dear STATA Gods,

Let me predicate this on the fact that I am by no means a great stata programmer. I'm constantly learning new things, so forgive my ignorance. I doubt I am going about things in the best way.

I would like to know whether it is possible to pass a local variable to a subsequent do file called from my main do file. That is, I often call other do-files from a main file and use them like subroutines. It keeps my code shorter.

Recently, however, I ran into a situation where the do file I am calling doesn't remember the local macro names I assigned in the main program. The local macro name in question stems from a foreach loop, so I can't use global assignment.

Thank you for any help.

Yours Sincerely,

Bryce


Bryce Mason, Ph.D.
Director of Institutional Research
Loyola Marymount University
1 LMU Drive | Los Angeles, CA 90045

b:	4823 University Hall
w:	(310) 258-8838
f:	(310) 338-1841
e:	bmason5@lmu.edu




*
*   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   |   What's new   |   Site index