Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: adding quotes to a macro or variable


From   Keith Dear <[email protected]>
To   [email protected]
Subject   Re: st: adding quotes to a macro or variable
Date   Tue, 18 Mar 2008 08:34:38 +1100

Laura,
You can do this using compound quotes:

. local l `""xxx""'
. mac list _l
_l:             "xxx"

See -help quotes- for more.
Keith


At 08:18 AM 18/03/2008, you wrote:
Is there any way I could change a macro value from xxx to "xxx".

.local l="xxx"
.di "`l'"
xxx

I want the macro to actually be "xxx", including the quotes. I've tried adding them around with no success, and things like

. local l="xxx"

. local l='"`l'"'
'"xxx"' invalid name
r(198);

But as you can see I'm in need of help. I'm in version 10 on Windows XP.

thanks- Laura

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Laura E. Gibbons, PhD
General Internal Medicine, University of Washington
Box 359780, Harborview Medical Center, 325 Ninth Ave, Seattle, WA 98104
phone: 206-744-1842, fax: 206-744-9917, Office address: 401 Broadway, Suite 5122
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* 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/

Dr Keith B.G. Dear
Senior Fellow in Biostatistics
National Centre for Epidemiology and Population Health
Australian National University
Canberra, ACT 0200, Australia
Tel: 02 612 54865, Fax: 02 612 50740
http://nceph.anu.edu.au/Staff_Students/staff_pages/dear.php
CRICOS provider #00120C

http://canberragliding.org/

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



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index