Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: compiling mata from ado file


From   László Sándor <sandorl@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: compiling mata from ado file
Date   Wed, 16 May 2012 14:59:30 -0400

Sorry about this, I solved this. I did not know that you cannot save
an mo file if the Mata code is within the ado file. That case the
Stata program's Mata use won't find the Mata function defined later.

On Wed, May 16, 2012 at 12:06 PM, László Sándor <sandorl@gmail.com> wrote:
> Hi all,
>
> I am not sure why this does not work for me: Shouldn't ado files work
> with a structure like this?
>
> program define ...
> ...
> mata: myfunction()
> end
> mata:
> void function myfunction(...) {
> ...
> }
> mata mosave myfunction(), replace
> end
> exit
>
> This way I got the error that the program does not find the Mata
> function. (It works if I swap the order of the Stata and the Mata code
> though, but that looks silly.)
>
> My code runs fine if I precompile the Mata code and the ado only looks
> for the .mo files. But I don't want to do that as I don't want version
> control on the Mata code (newer versions will compile faster code,
> no?).
>
> Thanks for any thoughts,
>
> Laszlo
> *
> *   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index