Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: question about gettoken and file


From   Edwin Leuven <[email protected]>
To   [email protected]
Subject   Re: st: question about gettoken and file
Date   Wed, 26 Mar 2003 12:09:30 +0100

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index