Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

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


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   AW: st: the convenient way to exclude part of the do file from running
Date   Tue, 20 Apr 2010 17:31:32 +0200

<> 


As you can see from this small sample of opinions, there is no way you can do this totally painlessly. Some commenting out must happen one way or the other. My Ultraedit lets me code-fold, so the lines commented out also disappear from view if I want them to, which is an added benefit...



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] Im Auftrag von Maarten buis
Gesendet: Dienstag, 20. April 2010 17:26
An: [email protected]
Betreff: Re: st: the convenient way to exclude part of the do file from running

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


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index