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: executing do file in current namespace [was calling another .do file?]


From   Nick Winter <nwinter@virginia.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: executing do file in current namespace [was calling another .do file?]
Date   Tue, 20 Jul 2010 09:49:03 -0400

Very cool - I had never realized that you can use -include- interactively, which executes a .do file in the interactive namespace -- so locals set in the interactive session are visible to it, and those set in the do file persist after it finishes.

Not sure exactly how this would be useful, but seems like it might be in some context...

Nick Winter

On 7/19/2010 12:23 PM, Jeph Herrin wrote:
Three ways actually, because you can also -include-
a .do file, which will excute the commands and display
the output, while retaining local macros when control
returns to the file which -include-ed it.

cheers,
Jeph


Yes, there are two ways: -do- will execute the commands in the
.do file and displays the output, while -run- executes the
commands but suppresses the output. See -help do-.

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------




*
* 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/

--
--------------------------------------------------------------
Nicholas Winter                                 434.924.6994 t
Assistant Professor                             434.924.3359 f
Department of Politics                  nwinter@virginia.edu e
University of Virginia          faculty.virginia.edu/nwinter w
S385 Gibson Hall, South Lawn
*
*   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