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

RE: st: Programming question.


From   adiallo5@worldbank.org
To   statalist@hsphsun2.harvard.edu
Subject   RE: st: Programming question.
Date   Thu, 18 Aug 2005 14:09:46 -0400

Nick, Tom,
Thanks for support.
I've gone the way suggested by Tom,
though Nick's code gave me new ideas for
another program I want to implement.
Thanks very much.
Best regards.
Amadou.




                                                                                                                                               
                      n j cox                                                                                                                  
                      <n.j.cox@durham.ac.uk>           To:       statalist@hsphsun2.harvard.edu                                                
                      Sent by:                         cc:                                                                                     
                      owner-statalist@hsphsun2.        Subject:  RE: st: Programming question.                                                 
                      harvard.edu                                                                                                              
                                                                                                                                               
                                                                                                                                               
                      08/18/2005 01:55 PM                                                                                                      
                      Please respond to                                                                                                        
                      statalist                                                                                                                
                                                                                                                                               
                                                                                                                                               
                                                                                                                                               




I agree. If abbreviations are to be allowed,
then this approach needs to be modified;
and Tom's method has a definite edge.

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

Steichen, Thomas J.

Nick Cox writes:
 > local wants_pca = inlist("`method'", "pca")
 > local wants_fac = inlist("`method'", "factor")
 > local wants_mca = inlist("`method'", "mca")
 > if (`wants_pca' + `wants_fac' + `wants_mca') == 0 {
 >           di as err "need at least one of factor pca mca"
 >           exit 198
 > }

One would need to consider ramifications of abbreviations
of "pca", "factor", and/or "mca".  I suspect (but have not
tested) that such would lead to problems via this approach.
Abbreviations of separate options would be handled by Stata's
parser in the expected manner.

My KISS approach (separate options) avoids these unparsed
nested option issues and is quite Stataish (and, though suboptions,
a la graph8, have become more mainstream, I find them much
harder to punctuate correctly!).
*
*   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/



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