Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: question: mata compilation line skip rules


From   Maarten Buis <maartenlbuis@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: question: mata compilation line skip rules
Date   Thu, 29 Mar 2012 22:03:23 +0200

2012/3/29 László Sándor :
> One of the biggest hints one gets when Mata does not compile is how
> many lines were skipped. (I cannot get myself a line number with -set
> matalnum- or -set matadebug-.)
>
> I could not find the documentation on the rules how this is done. How
> could I reverse engineer which piece of my code did not compile?
>
> I have an ado file with multiple Mata function definitions at the end,
> also cross-referencing to one another.

One way is to open the ado file in the do-file editor and do that .ado
file. This in essence treats the .ado file as a .do file that creates
a (set of) program(s) and Mata functions. You usually have to first
type -clear all- to make sure none of these aren't already in memory.
What you are looking for are the first error messages in the Mata
section. These are usually a pretty good indicator of where the
problem is. The later error messages are usually just the results of
the earlier errors and not very informative.

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany


http://www.maartenbuis.nl
--------------------------

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index