[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
RE: st: question about gettoken and file
> 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'
Not with an ado. One explanation of the issues
They key principle is the substitution first rule:
Stata will replace all macro names by their current
contents (possibly, nothing) before passing the remainder
of the line to the ado.
* For searches and help try: