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

Re: Re: st: RE: Version control questions


From   Richard Williams <Richard.A.Williams.5@ND.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: Re: st: RE: Version control questions
Date   Wed, 01 Jun 2005 16:21:46 -0500

At 01:12 PM 4/29/2005 -0500, khigbee@stata.com wrote:
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...

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')

            ...
I finally got Stata 9 and can confirm that the above code works as desired under both 8.2 and 9.0, e.g. 9.0 users could specify -level(99.9)- if they were so inclined while 8.2 users would still be limited to using integers.

I wonder if there are other potential applications along these lines - for example, could you have a "slow" subroutine written in 8.2, and a much faster one written in 9.0 using Mata?


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: Richard.A.Williams.5@ND.Edu
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc

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