As far as I know you have to use Stata 9 to compile a function, if you
want to use the function in Stata 9 (a Stata 9 compiled function,
however, will also work under Stata 10).
If you don't have Stata 9 then my suggestion would be to just include
the source code in an ado-file so that it compiles on the fly.
ben
On Fri, Feb 13, 2009 at 11:35 PM, Partha Deb <[email protected]> wrote:
> Hi all,
>
> I am trying to compile and save a Mata function as a .mo file. I am using
> Stata 10.1 but would like to compile and save the .mo file as a Stata 9.2
> file. My understanding is that this should be possible under version
> control but I'm not succeeding. Here are the essentials of the .do file I
> use to create the function:
>
> clear all
> version 9.2
> local mydir "."
>
> mata:
> void myfunc(
> string scalar lnL, string scalar G, ...)
>
> {
> define the function
> }
>
> mata mosave myfunc(), dir(`mydir') replace
>
> end
>
> This runs fine and saves a .mo function that I can use in Stata 10.1. But
> when I try to use it in Stata 9.2, I get the following error message:
>
> (myfunc() in /home/pdeb/ado/plus/m/myfunc.mo, compiled by Stata 10.1,
> is too new to be run by this version of Stata and so was ignored)
>
> Your thoughts are most appreciated.
>
> Cheers,
>
> Partha
>
>
> --
> Partha Deb
> Department of Economics
> Hunter College
> ph: (212) 772-5435
> fax: (212) 772-5398
> http://urban.hunter.cuny.edu/~deb/
>
> Emancipate yourselves from mental slavery
> None but ourselves can free our minds.
> - Bob Marley
>
>
> *
> * 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/
>
*
* 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/