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, statalist.org is already up and running.


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

Re: st: the convenient way to exclude part of the do file from running


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: the convenient way to exclude part of the do file from running
Date   Tue, 20 Apr 2010 15:25:57 +0000 (GMT)

--- On Tue, 20/4/10, Amanda Fu wrote:
> I was wondering if there is any more convenient way to
> exclude some part of the do file from running in the 
> process of writing and revising a do file.
> 
> For example, I am working on a do file with 1000 lines of
> commands, in which  I would like to exclude  the bottom 100
> lines from running  and checking.  I have not decided if I
> should permanently delete the 100 lines from this do file
> or not.

I would start with breaking that large .do file up in smaller
.do files. This tends to lead to much easier to read code, 
and thus (hopefully) less errors. You would than create a 
master.do file which calles each of these sub-routines using
the -do- command. This way, you keep a good general overview
while you look at the master.do file, especially if you give
the subroutines meaningful names, and you can get more 
detail by looking in the sub-routines. In your case you would 
probably put the 100 lines in a sub-routine and comment the 
call to that subroutine out.

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/


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