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 on April 23, and its replacement, 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 <>
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.


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 L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen

* For searches and help try:

* For searches and help try:

Nicholas Winter                                 434.924.6994 t
Assistant Professor                             434.924.3359 f
Department of Politics         e
University of Virginia w
S385 Gibson Hall, South Lawn
*   For searches and help try:

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