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

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