Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: Using macval with r-objects


From   Niklas Kaunitz <niklaspe@hotmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Using macval with r-objects
Date   Thu, 13 Dec 2012 20:49:10 +0100

Nevermind, I found the answer myself, it turned out to be simple.

Evaluating loc a = r(string) automatically prevents macro expansion within r(string).

I think this should be explicitly mentioned in the manual when describing the difference between the constructions
loc a `r(string)'
and
loc a = r(string)

Niklas Kaunitz

13 dec 2012 kl. 12.30 skrev Niklas Kaunitz:

> Hi everybody,
> I have a question about how to apply macval() on saved results in r(...) locals.
> 
> I have a program that returns r(string) that can contains characters like ` and $. How can I copy this to another macro without internal macro substitution? The obvious guess `macval(r(string))' does not work...
> 
> Niklas Kaunitz
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
> 


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index