> But anything with Mata is automatically 9 at least.
To keep a hybrid version of a command that uses Mata in Stata 9 or
newer but also works in Stata 8.2 (using a non-Mata variant of the
code) you could do something like:
---example.ado---
program define example
version 8.2
...
if c(stata_version)<9 {
... // Stata 8
}
else {
mata: example_mata() // Stata 9 using Mata
}
...
end
if c(stata_version)<9 exit
version 9.2
mata:
void example_mata()
{
...
}
end
---example.ado---
See, for example, -estwrite.ado- (ssc describe estwrite).
ben
*
* 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/