On Tue Mar 25 2003 16:57, Jeff Pitblado, Stata Corp. wrote:
> The following is a log from a do-file I wrote. The point here is that
> macro expansion characters (` and $) need to be escaped to prevent the
> macros from being expanded. Thus if Edwin wants to write "di `i'" to a
> file using -file-, he must use "di \`i'".
thanks. i was wondering (and trying) whether something like the following is
possible with an ado:
pforeach v1 of var x1-x3 \ v2 of var y1-y3 \ i in 1 2 3: g z`i' = `v1'*`v2'
now i know that the only way to do this is:
pforeach v1 of var x1-x3 \ v2 of var y1-y3 \ i in 1 2 3: g z\`i' = \`v1'*\`v2'
thanks again to all who responded, Ed.
*
* 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/