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]

st: passing a function name as an argument to another function in Mata


From   Zurab Sajaia <[email protected]>
To   statalist <[email protected]>
Subject   st: passing a function name as an argument to another function in Mata
Date   Tue, 23 Aug 2011 15:36:20 -0400

Dear all,
 
I'm trying to write a function that receives name of another function as an argument and executes it. So it's something like this:
 
 
functin myexecute(string scalar fname)
{
   ... somehow execute fname...
} 
 
 
 
:myexecute("myfunction()")
 
 
I can't use p=&functname() construct to than pass the pointer p to myexecute() and couldn't find any other option. Any suggestions whether this is possible at all?
 
Thanks,
Zurab
 
  		 	   		  
*
*   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