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]

st: Collapsing lines of code in a do file


From   Tunga Kantarcı <[email protected]>
To   [email protected]
Subject   st: Collapsing lines of code in a do file
Date   Mon, 2 Jul 2012 16:09:31 +0200

Hello,

I have a do file which includes many lines of code. As the code
started to get messy, I decided to classify the code in my do file
into subsections with respect to the particular analyses I consider.
More precisely, what I did is the following:

*-------------------------------
* Descriptive statistics
*-------------------------------
{
summarize y
bla
bla
bla
}
*

*------------------------------
* Regression analysis
*------------------------------
{
summarize y
bla
bla
bla
}
*

When you open and end curly brackets as I exemplified above in a do
file, the do file editor adds a "plus sign" next to the first curly
bracket and if you click on it the content enclosed between the
brackets is collapsed. This gives you a way to group your long code
into subsections so that the entire do file becomes easier to trace
for a third party.

The problem is that when you reopen your do file, all the code is
expanded so you need to click on the "plus sign" to collapse the code
in the subsections again. This is very annoying as you have to do it
every time you open the do file.

My question: Is there a way to avoid expansion of the content within
two curly brackets when a do file is opened?

Thanks in advance,
Tunga
*
*   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