Statalist


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

st: How to get a macro with content `something'


From   Alex Gamma <[email protected]>
To   statalist <[email protected]>
Subject   st: How to get a macro with content `something'
Date   Tue, 26 Jan 2010 15:01:05 +0100

Dear Statasticians,

although I feel I must be overlooking something big,
despite checking [P] and [U] and the Statalist archives,
I wasn't able to figure out how I can simply get a local
macro A with content `something', but without expanding
`something' (something is a macro, too, that contains,
let's say, foo1 [. loc something foo1]).


I couldn't get it to work using "\".
If I code
. loc A \`something'

I will get, as desired,
. mac list _A
_A:             `something'


But if I use A in code, e.g.
. loc s "`A'" + "foo2"

I get
.mac list _s
_s:              "foo1" + "foo2"
instead of
_s:              `something' + "foo2"

Likewise
. di "`A'"
returns
foo1
instead of
`something'


Is what I want impossible or even unnecessary?

Alex
*
*   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