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: Comment oddity with #delimit ;


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Comment oddity with #delimit ;
Date   Thu, 14 Apr 2011 13:16:43 +0100

This kind of thing has been aired from time to time on Statalist.
Search the archives for e.g. "comment delimiter".

I think this is a bug for you in the sense that your intentions, clear
from the code, have been misunderstood by Stata. The flip answer is
"Don't do that then!" but StataCorp may have a better answer.

I almost never use #delimit ; except around long -graph- commands. I
find the combination of // and /// catches almost all needs of
commenting and of continuing long lines in do-files or programs.

Nick

On Thu, Apr 14, 2011 at 12:28 PM, Brendan Halpin <brendan.halpin@ul.ie> wrote:
> Consecutive comments can cause a problem when using semi-colons to
> delimit:
>
> +- test.do -----------------------------------------------------------------
> #delimit ;
> di "test one";
>
> // Comment line one;
> // Comment line two;
>
> di "test two";
> +---------------------------------------------------------------------------
>
> Do-ing this yeilds the following:
>
> +---------------------------------------------------------------------------
> . do test.do
>
> . #delimit ;
> delimiter now ;
> . di "test one";
> test one
>
> . // Comment line one;
>> // Comment line two;
> unrecognized command:  / invalid command name
> r(199);
>
> end of do-file
>
> r(199);
> +---------------------------------------------------------------------------
>
> Semi-colons at the end of comments have no effect.
> Dropping either of the comments resolves the problem.
> Reverting to -#delimit cr- resolves the problem.
> Using C-style comments (/* ... */) resolves the problem.
>
> This is Stata 11, under Linux.
>
> Am I missing something or is this a bug?
>

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