[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
RE: st: RE: Parsing of multiple -if- lines
> -----Original Message-----
> From: David Kantor [mailto:firstname.lastname@example.org]
> Sent: Tuesday, August 13, 2002 1:00 PM
> To: email@example.com
> Subject: Re: st: RE: Parsing of multiple -if- lines
> At 12:33 PM 8/13/2002 -0400, Nick Winter wrote:
> >When the -else- clause is removed, then the program crashes only when
> >the second token is set to an asterisk, suggesting that it is the
> >comments in there that are somehow confusing things?
> I'm not totally clear about this, but I think that Stata
> expects a loaded
> program to have no commented-out text. That is, any
> commented-out text it
> finds at load time is stripped out; once loaded, a program has no
> comments. (Do -program list-; you will see: no more
> comments.) But now
> you are introducing a new twist: parts of the program become
> at run time. Perhaps the comment-skipping feature does not
> operate (at
> least, not completely) while running a program, as it is
> presumed to have
> already gone through that step at load time.
Interestingly, although Stata drops any commented lines when loading a
program, it is also happy to encounter comments as it interprets the
lines at execution. The local macros `1' '2', are not substituted until
runtime, so the lines remain.
This simpler version makes it clear:
prog define myprog3
`1' di "line one"
`2' di "line two"
`3' di "line three"
. myprog3 " " " " " "
. myprog3 " " " " "*"
* For searches and help try: