Greetings,
Am I missing something obvious, or is there something weird about how
Stata chokes on the following program -mytest-, but does not choke on
-mytest2-? That is, using a macro to selectively comment out lines of
code seems to work, except when it is within an -if- block :
program define mytest
if `1'==1 {
`2' if `3'==1 {
`2' di "three is set to one"
`2' }
}
else {
`2' if `3'==1 {
`2' di "three is set to one"
`2' }
}
end
prog define mytest2
`2' if `3'==1 {
`2' di "three is set to one"
`2' }
end
. mytest 1 " " 1
three is set to one
unrecognized command: } invalid command name
r(199);
. mytest 1 "*" 1
unrecognized command: } invalid command name
r(199);
. mytest2 1 " " 1
three is set to one
. mytest2 1 "*" 1
--Nick Winter
-----------------------------------------------------------
Nicholas Winter, Ph.D. P 202.939.5343
Policy Studies Associates F 202.939.5732
1718 Connecticut Avenue, NW [email protected]
Washington, DC 20009-1148 www.policystudies.com
-----------------------------------------------------------
<<winmail.dat>>