Try -foreach-
For example:
local x "a b c d e"
foreach l of local x {
local wx "`wx' w`l'"
}
disp "`wx'"
Scott
> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Oleksandr Shepotylo
> Sent: Monday, May 08, 2006 3:35 PM
> To: Stata; Oleksandr Shepotylo
> Subject: st: how to add specific letter to string macro
>
> Dear Statalist users,
>
> Suppose that I have a local macro
>
> loc X = " a b c"
>
> I want to create a local macro
>
> loc WX="wa wb wc"
>
> The problem is that I want to automate the process and write a code that
> will create `WX' based on string stored in `X'.
>
> Can anyone help me with this?
>
> Thanks,
>
> Oleksandr Shepotylo.
*
* 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/