Nick,
Quoting Nick Cox <[email protected]>:
> There was a while back a limit of 7 on the number of
> characters in a local macro name. Perhaps some earlier statement
> in your code is setting the -version- back
> so that limit bites.
That's it! Thanks.
--Mark
>
> Nick
> [email protected]
>
> Mark Schaffer
>
> > Hi everybody. I've run into some funny behaviour by Stata
> > when dealing
> > with macros inside a programme.
> >
> > Here's a snippet of a -trace-. The programme calls -test-,
> > then displays
> > the results, then uses -tempname- to allocate some more local
> > names for
> > scalars. It assigns a value to the new local `hpvalue',
> > which has been
> > given the local variable __00000O. Not shown are two earlier
> > lines that
> > assigns values to previously-defined locals `hpvalue1' and
> > `hpvalue2'.
> > The last command asks Stata (8.2, btw) to display the values
> > of both of
> > these locals.
> >
> > scalars:
> > r(drop) = 0
> > r(chi2) = 7.778333995775768
> > r(df) = 1
> > r(p) = .0052876538356317
> > - tempname htest hpvalue hdf hsigma
> > - scalar `htest'=r(chi2)
> > = scalar __00000N=r(chi2)
> > - scalar `hpvalue'=r(p)
> > = scalar __00000O=r(p)
> > - di "hpvalue1=" `hpvalue' " hpvalue2=" `hpvalue2'
> > = di "hpvalue1=" __00000O " hpvalue2=" __00000O
> > hpvalue1=.00528765 hpvalue2=.00528765
> >
> > What is curious is that both `hpvalue1' and `hpvalue2' are
> > expanded to the
> > local variable that was assigned to `hpvalue', namely __00000O.
> >
> > Eventually I got rid of the bug by using shorter local macro
> > names. But
> > `hpvalue1', for example, has only 8 characters. Did I miss a
> > bit in the
> > manual that says that local macros have to have names with
> > fewer than 8 (!) characters?
>
> *
> * 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/
>
Prof. Mark Schaffer
Director, CERT
Department of Economics
School of Management & Languages
Heriot-Watt University, Edinburgh EH14 4AS
tel +44-131-451-3494 / fax +44-131-451-3008
email: [email protected]
web: http://www.sml.hw.ac.uk/ecomes
________________________________________________________________
DISCLAIMER:
This e-mail and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to
whom it is addressed. If you are not the intended recipient
you are prohibited from using any of the information contained
in this e-mail. In such a case, please destroy all copies in
your possession and notify the sender by reply e-mail. Heriot
Watt University does not accept liability or responsibility
for changes made to this e-mail after it was sent, or for
viruses transmitted through this e-mail. Opinions, comments,
conclusions and other information in this e-mail that do not
relate to the official business of Heriot Watt University are
not endorsed by it.
________________________________________________________________
*
* 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/