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, is already up and running.

[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 <>
To   StataList <>
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


then I attempt to execute the following:

mMemSave = strtoreal(st_global("MemSave"))

if (mMemSave > 0) mata drop FirmRawRet

yet I get:

invalid expression

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.


Thomas Jacobs
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index