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

st: The -version- command [was: problem with use of ou treg addstat]


From   "Jann, Ben" <[email protected]>
To   <[email protected]>
Subject   st: The -version- command [was: problem with use of ou treg addstat]
Date   Mon, 14 Mar 2005 12:21:21 +0100

Nick wrote:
> -estout- as available from SSC requires Stata 8.2. 
> This is apparent from looking at the code. 
> 
> That said, I am puzzled at the message you report. 
> It is difficult to see how you got -estout- even 
> to start given your use of an out-of-date version
> of Stata. 
> 
> No doubt Ben Jann will be able to elucidate when 
> he comes on-line.

Stata 7 fails loading estout.ado because -estout- uses 
Stata 8 syntax.

[The "unrecognized command:  DMarker" message is 
displayed because in estout's code the word "end" 
appears before a line containing "DMarker...". Stata 
7 thinks that "end" ends the definition -estout- and 
tries to execute the -DMarker-.]

I think, this raises a general problem:

The -estout- code contains the command -version 8.2- 
which is intended to ensure compatibility with future 
versions Stata and, moreover, to tell users of older 
versions that -estout- cannot be executed on their 
system. However, the program cannot be loaded in 
Stata 7 in the first place (because of syntax 
conflicts) and, thus, the -version 8.2- command is 
not executed at all.  

A solution to the problem would be to additionally 
place a version statement outside the -program define- 
environment in estout.ado. Currently, the irst few lines 
of estout.ado are:
===================
*! version 2.15, Ben Jann, 14feb2005

program define estout, rclass
	version 8.2
	syntax [anything] [using] [ , ///
	 Cells(string asis) ///
	 Drop(passthru)  ///
...
===================

Stata 7 only produces a meaningful error message 
("version 8.2  not supported") if the code would
be: 
===================
*! version 2.15, Ben Jann, 14feb2005

version 8.2
program define estout, rclass
	version 8.2
	syntax [anything] [using] [ , ///
	 Cells(string asis) ///
	 Drop(passthru)  ///
...
===================

(Note that the version 8.2 caller after -program 
define- is still necessary, because the first 
-version- command is only executed while reading
estout.ado, but not when executing -estout-!)

Thus, my question is: Should it be a general 
advice for programmers not only to include the 
-version- command inside the program definitions 
(see U[21.11.1 Version]), but also to include the 
-version- command at the very beginning of an
ado-file? Or would this cause some other problem?

ben

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index