Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: comment in log


From   austin nichols <[email protected]>
To   [email protected]
Subject   Re: st: RE: comment in log
Date   Fri, 2 Dec 2005 09:23:43 -0500

Also try:

#delimit;
cap log using mylog, replace;
command;
cap log off; /* comment on command */ cap log on;
next command;
cap log off; /* comment on next command */ cap log on;
cap log close;

Where "cap log off" is the only indication of a comment in your
do-file. If you want no record of the comment, you will have to put
the commands in a program, as Nick suggests:

#delimit;
cap prog drop allcommands;
prog def allcommands;
cap log using mylog, replace;
command;
cap log off; /* comment on command */ cap log on;
next command;
cap log off; /* comment on next command */ cap log on;
cap log close;
end;
allcommands;

where now the "cap log off" and "cap log on" are superfluous, but
retained for symmetry (and so if you cut and paste them later you
don't have to retype them).  Note that inside a program, the commands
themselves will not be visible, only their output, so you might want
to do something like this if you want to see the command syntax before
the output:

#delimit;
cap prog drop allcommands;
prog def allcommands;
cap log using mylog, replace;
di "command"; command;
cap log off; /* comment on command */ cap log on;
di "next command"; next command;
cap log off; /* comment on next command */ cap log on;
cap log close;
end;
allcommands;

On 12/2/05, Nick Cox <[email protected]> wrote:
> Are you familiar with the difference between
> -run- and -do-?
>
> Alternatively, convert your do file to a program.
> Then you can put comments exactly where you
> want, subject to a few rules.
>
> Nick
> [email protected]
>
> Alvine Bissery
>
> > Thank you again, but with this method, I could not
> > comment each line directly ... I will loose qulity of
> > documentation
>
> Maarten Buis
>
> > > One way to put comments in your do file which will
> > > not show up in the output is to end your do-file
> > > with -exit- and write your comments underneath
> Alvine Bissery
>
> > > Is there a way not to display the comment in a log
> > > file when running a .do file ?
>
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index