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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: RE: how to save an instance of a class in MATA


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: how to save an instance of a class in MATA
Date   Fri, 16 Dec 2011 11:47:48 +0000

I don't think you can store classes; you can just store definitions of classes, which can be done through a do-file containing the corresponding Mata code. 

Even if I am wrong, what use would a stored class be? What would it look like? 

A simple analogy is with a graph file. A graph file does not contain a graph, but rather instructions on how to draw a graph.  

(For that matter, I suppose a data file is really just a collection of bits that a program knows how to read as data.) 

-f??tmatrix()- only know about matrices and is no use to you here. 

Nick 
n.j.cox@durham.ac.uk 

michel.grzebyk@inrs.fr

I would appreciate if someone can help me with how to save in a file an 
instance of a class in MATA and then how to read it later.
I know that for instance of structures, fputmatrix() and fgetmatrix() can 
be used. Can these functions be used too with instances of classes?


*
*   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