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

Re: Re: st: RE: Version control questions


From   khigbee@stata.com
To   statalist@hsphsun2.harvard.edu
Subject   Re: Re: st: RE: Version control questions
Date   Fri, 29 Apr 2005 13:12:36 -0500

Richard Williams <Richard.A.Williams.5@ND.edu> asks:

> Thanks Ken.  So, to modify Nick's example, if my program is written in 8.2 
> but I want to let the 9.0 users use the new level options, could I say
> 
> program myprog
>          version 8.2
>          local oktype = cond(`c(version)' < 9, "integer `c(level)'", 
> "cilevel")
>          syntax ... , ... Level(`oktype')
> 
> Eventually I may write a version for Stata 9, but in the meantime it seems 
> a shame to cripple the program for Stata 8 users if all you are doing is 
> adding support for the new level options.  There are lots of other 
> user-written programs that use integer levels, so programmers who are so 
> inclined could make one quick change in them without having to set version 
> to a higher number.

Almost.  There is one error in the original suggestion (I did not
see it previously).  Instead of checking against `c(version)'
check against `c(stata_version)'.

So it should look something like

    program myprog
            version 8.2
            local oktype = cond(`c(stata_version)' < 9, ///
                                "integer `c(level)'", "cilevel")

            syntax ... , ... Level(`oktype')

            ...


Ken Higbee    khigbee@stata.com
StataCorp     1-800-STATAPC

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