Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: How to identify different versions of the a program within other program


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: How to identify different versions of the a program within other program
Date   Fri, 21 Mar 2008 15:31:49 -0000

I don't think so. But you needn't check that way. 

Your branch might as well be 

if "$S_2" != "" local myresult $S_2 
else local myresult = e(tau2)

Nick 
[email protected] 


[email protected]


I am writing a program that calls another program to perfom part of its
calculations. However, the program I want to call has two versions, say,
version 1 and version 2, respectively. In this specific case, I am
working
with -metareg-, but have more examples with the same issue.

The problem is that the former version outputs the result I am looking
for
in a global $S_2, whereas the latter outputs the same result as e(tau2).

Is there a way to identify the version of -metareg- that the user is
using
so that  I can write a simple loop such as:

if "`version 1'" {

local myresult= $S_2
}
else {
local myresult = e(tau2)
}

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