Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "David Radwin" <dradwin@mprinc.com> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | st: RE: local command with blanks |
Date | Mon, 27 Dec 2010 08:58:00 -0800 (PST) |
You need to use compound quotation marks, also called compound quotes. See http://www.stata.com/statalist/archive/2002-06/msg00436.html for an explanation and illustration. David -- David Radwin Research Associate MPR Associates, Inc. 2150 Shattuck Ave., Suite 800 Berkeley, CA 94704 Phone: 510-849-4942 Fax: 510-849-0794 www.mprinc.com > -----Original Message----- > From: owner-statalist@hsphsun2.harvard.edu [mailto:owner- > statalist@hsphsun2.harvard.edu] On Behalf Of Kamyar Baradaran > Sent: Monday, December 27, 2010 7:59 AM > To: statalist-digest@hsphsun2.harvard.edu > Subject: st: local command with blanks > > Dear All, > > How can I create a local variable when I have blanks. I would like to > have such a thing: > local year_criteria " "year < 2000 & age == 1" "yea r< 2002 & age == > 2" " > I would like to use it in foreach command: > > foreach criteria in `year_criteria' { > ... > } > > Thanks, > Best, > K > * > * 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/ * * 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/