Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: adoupdate question


From   Richard Williams <[email protected]>
To   "[email protected]" <[email protected]>, "[email protected]" <[email protected]>
Subject   Re: st: adoupdate question
Date   Mon, 29 Jun 2009 23:48:20 -0500

At 08:40 PM 6/29/2009, Alan Riley wrote:

This takes no more work for an author who was going to create
both x.ado and x_10.ado anyway, but it is cleaner for end-users.
It also means that even if a user installs an updated version
of the 'x' package, as long as they have used version control in
their own do- and ado-files, the appropriate version of -x-
will be executed.

Thanks much Alan.  That looks very useful.  A few Qs though:

* Is there a similar trick for help files? If not, it could get cumbersome adding lines like "Stata 11 only. " Also, a help file that works in Stata 11 might use features that don't work in earlier versions of Stata.

Note that, when Stata 11 has a program that supports version control, it still only has a version 11 help file, right? That is a little different from the situation of some one who might want a different help file for each version of their program.

* Do prefix commands and byability pass through ok with this sort of coding? I'm used to seeing a -program define- statement early in a program, which defines properties like swml and svyr, but maybe those can be handled by the program that gets called. But if x.ado must itself define the properties, you have a potential problem because the program define command differs across versions of Stata.

As a sidelight, my gologit2 program was written for Stata 8.2, but when 9 came out I wanted it to also support some of the new properties. So, the opening code is like this:

capture program gologit2, eclass byable(recall) sortpreserve ///
        properties(swml or rrr irr hr eform)
if `c(stata_version)' < 9 program gologit2, eclass byable(recall) sortpreserve

        if `c(stata_version)' < 9 {
                version 8.2
        }
        else {
                version 9
        }

I don't know if that is good programming practice, but it seems to work!


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  [email protected]
WWW:    http://www.nd.edu/~rwilliam

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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