I had provided this on Aug 9th, but when I scanned the Archive I
realized it had ended up in Statalist Limbo:
I'm wondering if escaping the interior ` (as a \`) would work:
-file write `handle' `"capture label variable `=VarName[`x']'
\`"`=VarLabel[`x']'"' "' _n-
I find the display command can often be used to preview the results of
file write so you can test:
-di `"capture label variable \`"zTree (or other) Session ID
(alpha-numeric)"' "'-
which produces:
capture label variable `"zTree (or other) Session ID (alpha-numeric)"'
, the desired output.
D. C. Elliott
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/