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]
st: mata within a program or a loop
From
Shuaizhang Feng <[email protected]>
To
[email protected]
Subject
st: mata within a program or a loop
Date
Mon, 28 Oct 2013 20:19:31 +0800
Dear all:
I am using stata11.
I want to include certain mata commands within a program or in a loop.
Because the mata commands starts with "mata:" and ends with "end", I
am having some problems here. stata would stop when it hits the "end"
command of mata. does someone know how to deal with this issue?
for example, i write:
local i=1
do while i<=100{
....
mata:
...
end
.....
}
then the loop will break when it hits the "end" for the mata codes.
similarly, when I write:
program define xxx
....
mata:
...
end
....
end
xxx
stata also has program differentiating the two "end"s, and will stop
after the first "end" for the program.
Thanks in advance for your help.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/