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

Re: st: RE: expanding a local that contains a list or wildcards


From   "Dimitriy V. Masterov" <dvmaster@lily.src.uchicago.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: expanding a local that contains a list or wildcards
Date   Tue, 5 Aug 2003 15:44:36 -0500 (CDT)

Dear Statalist,

Numerous people have suggested using unab rhsvars : `rhsvars'. This is
exactly what I am looking for. Thank you very much for your help.

I do have a more general question. Let's say I have a silly program that
looked like this:

************************************************
program myprog
version 8.0
unab 0 : `*'

display " `0' "

local k=0
        while "``k''" !="" {
        local ++k
}

local --k

display "The number of variables is `k'"

end
*************************************************

For some reason, even though I redefined the 0 local to contain the
expanded variable list (without spaces), the subsequent loop appears to
use the original, unexpanded local 0. I am not sure why this is the
case. Is it possible to redefine 0?


Dimitriy Masterov


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index