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


From   Nick Cox <[email protected]>
To   [email protected]
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 <[email protected]> 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index