I recently came across something strange which I can't seem to understand. It concerns the way local variables in strings are inserted. I have the following code:
Code:
local def = 1000 local specification = `""(PC) at `def'""' di `specification' local filename = `""baseline estimates `specification'""' di `filename'
(PC) at 1000
baseline coefficients PC not found
r(111);
The strange thing is that this piece of code used to work a month ago, in that when I named a file with `filename', I'd get the name I wanted (so my file would be named 'baseline coefficients (PC) at 1000', without the quotations, though I did not try it with the display function).
Any idea on why this is happening? Any suggestions how I can circumvent this?
I'm on STATA 14.2 (Revision 29 Jan 2018).
0 Response to Bug in local variable with string?
Post a Comment