Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: change local macro


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: change local macro
Date   Mon, 1 Feb 2010 10:48:35 -0000

Also, 

local alpha 1 2 3 4 5 
local alpha : subinstr local alpha "1 " ""

In general, you can't change a macro without changing that macro, so
some kind of re-definition is essential. But how you do it is not
tightly prescribed. 

Nick 
[email protected] 

Martin Weiss

See - help macrolists-

*******
local alpha 1 2 3 4 5
di "`alpha'"
local not 1
local alpha: list alpha- not
di "`alpha'"
*******

raoul reulen

Suppose I define the content of a local macro named "alpha" as :

.local alpha 1 2 3 4 5

Can I adjust the content of the local macro without having to redefine
the local macro?
Can I remove, for example, the first number such that the content is
now 2 3 4 5 rather than 1 2 3 4 5?

Thus, if I type:

.di "`alpha'"

I (obviously) get:

1 2 3 4 5

but I want:

2 3 4 5

Obviously,

.di "`alpha'-1" or something wouldnt work....


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