Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Using macval with r-objects


From   Niklas Kaunitz <[email protected]>
To   [email protected]
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index