Dear Statalist,
I am having a problem with the following code. Please understand that it is schematic and I am using it this way, but with more content, in my program.
The problem is in the second part, it throws the error "} is not a valid command name" after printing "After capture 2", which it absolutely should not. It works when I replace $DEBUG_QUIET with noisily or quietly, but I would like to not do that.
I am working with Stata 14.0.
Thanks a lot,
Felix
I am having a problem with the following code. Please understand that it is schematic and I am using it this way, but with more content, in my program.
The problem is in the second part, it throws the error "} is not a valid command name" after printing "After capture 2", which it absolutely should not. It works when I replace $DEBUG_QUIET with noisily or quietly, but I would like to not do that.
I am working with Stata 14.0.
Thanks a lot,
Felix
Code:
// Just show that this concept generally works global DEBUG_QUIET quietly $DEBUG_QUIET di "test quiet" global DEBUG_QUIET noisily $DEBUG_QUIET di "test noise" // Show that it works with 1 if 1 { capture $DEBUG_QUIET { di as error "Inside 1" } di "After capture 1" } di "Now we are here 1" // Show that it does not work with 0 if 0 { capture $DEBUG_QUIET { di as error "Inside 2" } di "After capture 2" } di "Now we are here 2"
Comment