Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: question about -levelsof-


From   Jeph Herrin <junk@spandrel.net>
To   statalist@hsphsun2.harvard.edu
Subject   st: question about -levelsof-
Date   Tue, 05 Aug 2008 10:00:09 -0400

I find -levelsof- very useful, but a while back
decided it would be more useful if it also returned
the number of levels.

When I looked at the -ado- file, it seemed like
a trivial hack; the local macro -nvals- was already
there, so I just added

  return local nvals `nvals'

This seems to work, yet seems much too easy; but
looking through the code for a reason this
might sometimes fail, I couldn't find one.

So, my question is, is there a reason -levelsof-
doesn't return -nvals-? I use it so often, I worry
that maybe I'm setting myself up for disaster.

thanks,
Jeph
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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