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   Fri, 29 Apr 2005 14:00:10 -0500

At 01:12 PM 4/29/2005 -0500, you wrote:

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')
Good point! c(stata_version) is the version of Stata you really really are using, whereas c(version) is the version that is being mimicked by the version command. So, because of the version 8.2 command, in the original code the condition always would have evaluated as true.

It'll be a while before I can actually test this, but I'll try to remember to post whether it works ok or not. I can't imagine why it wouldn't, but I've been surprised more than once by things I was sure would work but didn't.

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