Statalist


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

Re: st: macro concat


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   Re: st: macro concat
Date   Sat, 24 May 2008 08:12:08 -0400

...

You need to use the macval function: Following the example below:

local c "`macval(a)' `macval(b)'"

macro list
<snip>
_c: `M1' `M2'
<snip>

Michael Blasnik


----- Original Message ----- From: "Keith Dear" <[email protected]>
To: <[email protected]>
Sent: Saturday, May 24, 2008 6:20 AM
Subject: Re: st: macro concat



No, that doesn't work:
. loc M1 hello
. loc M2 goodbye
. loc a \`M1'
. loc b \`M2'
. loc c `a' `b'
. mac list
_c:             hello goodbye
_b:             `M2'
_a:             `M1'
_M2:            goodbye
_M1:            hello

But I want:
_c:             `M1' `M2'

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