Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: getting the quotes right


From   "Steichen, Thomas" <STEICHT@rjrt.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: getting the quotes right
Date   Thu, 27 Jun 2002 10:07:24 -0400

Bill Gould followed up on a question from Håkon Finne and proposed: 

> What Håkon needs to have in `brands' is
>        
> `"(make=="Buick Century" | make=="Buick Electra" | make=="Buick Opel")"'
> `"(make=="Datsun 200" | make=="Datsun 210")"'
> `"(make=="VW Dasher" | make=="VW Rabbit" | make=="VW Scirocco")"'

This, unfortunately, leads to the dreaded macro length problem, as these commands show:

. local buicks  `"(make=="Buick Century" | make=="Buick Electra" | make=="Buick Opel")"'
. local datsuns `"(make=="Datsun 200" | make=="Datsun 210")"'
. local vws     `"(make=="VW Dasher" | make=="VW Rabbit" | make=="VW Scirocco")"'
. local brands  `"`buicks'"' `"`datsuns'"' `"`vws'"'
. 
. foreach brand of local `"`brands'"'  {
  2. list price if `brand'
  3. }
local macro name "(make=="Buick Century" | make=="Buick Electra" | make=="Buick Opel") too long 
r(198);
.

In this case, the macro length problem appears to be due 
to some internal problem in how -foreach- is handling macros.

StataCorp, is there a solution?

Tom Steichen  
CONFIDENTIALITY NOTE:  This e-mail message, including any attachment(s), contains information that may be confidential, protected by the attorney-client or other legal privileges, and/or proprietary non-public information.  If you are not an intended recipient of this message or an authorized assistant to an intended recipient, please notify the sender by replying to this message and then delete it from your system.  Use, dissemination, distribution, or reproduction of this message and/or any of its attachments (if any) by unintended recipients is not authorized and may be unlawful.




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