Statalist


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

Re: st: getting a list into a macro


From   Richard Goldstein <richgold@ix.netcom.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: getting a list into a macro
Date   Fri, 26 Sep 2008 15:57:23 -0400

Thanks - no embedded spaces, no missing values

Rich

Nick Cox wrote:
forval i = 1/`=_N' {
    local richslongmacro `richslongmacro' `=myvar[`i']'
}

I assume no embedded spaces within values: signal if otherwise.

Nick
n.j.cox@durham.ac.uk

Richard Goldstein wrote:

I have a string variable that is 6 characters long -- about 100 observations

I want to get each value into one long macro with spaces between each value -- how can I do that?
*
*   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–2025 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index