[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: comment out a number of lines together

From   Nick Cox <>
Subject   Re: st: comment out a number of lines together
Date   Tue, 30 Sep 2008 10:28:41 -0500

Another is to prefix lines by e.g.



local c *


local c //

comments out those lines.


local c

zaps the macro.

Naturally any definition of the local as "*" or "//" must precede all uses that require that interpretation.

The converse does not apply: if the local is not defined, Stata sees the line.

More generally, you can define or undefine the macro at will.

I don't especially recommend this method, but it is an alternative that is sometimes useful, and it matches practices in many programming languages.


Maarten buis wrote:

--- Paul O'Brien <> wrote:

at times i need to comment out a number of lines, usually with * and remove the * later to activate the commands.
is there a simple way to remove and add the * to a number of line at one go?
One way to comment out a block of code is to surround them with /* and
*/ this way you have to remove only these two.
*   For searches and help try:

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