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: Executing mata drop within a do file after an if condition
From
Thomas Jacobs <[email protected]>
To
StataList <[email protected]>
Subject
st: Executing mata drop within a do file after an if condition
Date
Sun, 30 May 2010 19:18:27 -0500
I am trying to drop a mata matrix within a do file while within the
mata environment but have been unable to get it to work.
Thus, I have a do file that begins in stata and at a point early on I have
mata:
then I attempt to execute the following:
mMemSave = strtoreal(st_global("MemSave"))
if (mMemSave > 0) mata drop FirmRawRet
yet I get:
invalid expression
r(3000);
I have checked that the if logic is correct in the immediate window
and have a similar line in many other locations of the program where
the result of the if condition is something different than mata drop.
I have also confirmed I can execute mata drop FirmRawRet from the
immediate window so I believe it is something related to mixing the if
with the mata drop command.
Can anyone enlighten me on what I am doing wrong here? Thanks.
Tom
--
Thomas Jacobs
*
* 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/