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]

Re: st: Bug in comment - and comment on comment


From   Ulrich Kohler <[email protected]>
To   [email protected]
Subject   Re: st: Bug in comment - and comment on comment
Date   Tue, 21 Sep 2010 12:58:04 +0200

Allan Reese (Cefas) wrote:
> Just found this in V10, so try it in other versions.  It's so blatant!
> 
> I have a long complex scatterplot command in a DO file, using /* */ to
> ignore line ends.  
> With the auto data, put this in a DO file.
> 
> scatter weight mpg [fw=price]  /* 
>    */ , ms(oh)
> di "here"
> 
> To see the graph with standard size markers, insert another
> start-comment
> 
> scatter weight mpg /* [fw=price]  /* 
>    */ , ms(oh)
> di "here"
> 
> And no output!  But /* inside /* */ should be ignored.  "What appears
> inside /* */ is ignored." (help comment).


Martin Weiss already answered this. However, regarding


> /* */ has another advantage I'd not noticed before.  When a command
> extends over several lines and you want to comment it out of the DO
> file, just add * to the first line and all following lines also start *
> so are comments.
> * scatter ... /*
> */ ... /*
>   */ etc 


note that this can be also with ///

scatter ... ///
        ... ///
        etc 


(Actually, /* */ has been the standard way to split commands over
several lines for many years. It has been superseded by /// with the
appearance of Stata 8.)

Many regards
Uli



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