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

st: Programming question.

Subject   st: Programming question.
Date   Thu, 18 Aug 2005 09:32:54 -0400

Dear Stata list,
I am writing an ado and face a problem in parsing
an option.
I want to add to my syntax an option (method)
which could be mca factor or pca.
The user could specify all the three or only one,
but must specify at least one.
But somehow, I can't figure how to parse that option.

So my code is :

syntax varlist [if] [in] [weight], Method(string)
 tokenize `method'
/*Here, the only I though of is to parse method and pass arguments one by one*/
if "$_1" == "factor" {
   I run factor analysis
if "$_2" == "pca" {

By I want the user to be able to specify all the methods he wants.
Also, I realized that if factor is not put in premiere instance, no method
is used.

I know there must be a simple way to do it, but just can't figure it.
Any help is welcomed.

Amadou Bassirou DIALLO.

*   For searches and help try:

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