Hello all,
I have a small question about whether or not it is possible to use a local macro to comment something out. (It's a weird question, very limited use, but of interested to me.)
For example, if I have the following command:
tab var1 if var2>0
Would it be possible to do something along the lines of the following to comment out the if statement?
local comment = "//"
tab var1 `comment' if var2>0
Whenever I run this code, Stata returns "/ invalid name". It seems that Stata is reading the outputted macro value as a variable name. Is this just how macros are parsed? Am I missing a way to do this?
Thanks!
Roger
I have a small question about whether or not it is possible to use a local macro to comment something out. (It's a weird question, very limited use, but of interested to me.)
For example, if I have the following command:
tab var1 if var2>0
Would it be possible to do something along the lines of the following to comment out the if statement?
local comment = "//"
tab var1 `comment' if var2>0
Whenever I run this code, Stata returns "/ invalid name". It seems that Stata is reading the outputted macro value as a variable name. Is this just how macros are parsed? Am I missing a way to do this?
Thanks!
Roger
Comment