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

st: Stata 6 vs. 7


From   HJW <[email protected]>
To   [email protected]
Subject   st: Stata 6 vs. 7
Date   Sat, 7 Sep 2002 15:22:23 -0700 (PDT)

Hi,

It seems I encountered an inconsistency between Stata 6 and
7, and I would like to ask for help. Say I have a program
like the follows.

   program define myexpl
     version 6.0
     syntax ...., ..... [myopt(varlist) .... ]

   end

In Stata 7, if I issue the command,

  myexpl ....., myopt()   /* empty in -myopt- */

then Stata will return empty for `myopt' in the program,
which is what I want.  However, if the same program runs
under Stata 6, then Stata complains with the message:

   myopt() is invalid

I know Stata 6 probably expects variable names in -myopt-,
so when no name is given it complains. However, I need the
behavior of Stata 7; is there any way to let Stata 6 behaves
like its next generation does? Something like default=none
may do, but this does not seem to work on options. Can
anyone help?  Thanks in advance.

[Just for those curious: I know his situation is odd,
because if an empty string is desired, why specify the
option -myopt- in the first place? Well, this is a part of a
complicated maximum likelihood program, which estimates
several different models. In order to preserve syntax
consistency across models, -myopt- is required if a
particular model is called, no matter whether it eventually
contains a varlist or an empty string. Alright, this may be
my own eccentric programing style, but please spare me with
the eccentricity.]

-- HJW


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index