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

st: RE: Parse multiple test equalities


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Parse multiple test equalities
Date   Wed, 31 Mar 2004 21:50:44 +0100

No, you don't have to do it this way. You can peel off
the leading tokens with -gettoken- _before_ using a -syntax- 
statement on the remainder. But given the rest 
of your design, I would probably go with -anything- 
and then -tokenize- thr result of that.  

Nick 
n.j.cox@durham.ac.uk 

Jun Xu
 
> I am trying to write a test command like:
> 
> mytest a=1 b=2 [if] [in], options  // something like that
> 
> I checked out the syntax for "syntax", but could not find any 
> template for 
> the command above. Do I have to first parse a=1 b=2 by using 
> somthing like
> 
> syntax anything [if] [in]
> 
> and then use either tokenize or gettoken to parse or is ther 
> an easy way 
> out? I would like easiy get locals containing a, 1, b, 2.
 

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index