Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: object persistence


From   Bill Rising <[email protected]>
To   "Stata Listserve" <[email protected]>
Subject   st: object persistence
Date   Wed, 22 Jan 2003 10:16:42 -0500

Hello people?

I've been playing around with the new object model in Stata 8, but I 
cannot seem to find any way to save instances from one session to 
another, or any way to attach objects to variables in a dataset. Am I 
missing something? I'm guessing not, because the objects seem to be 
extensions of ado files rather than extensions of data.

Here would be something which might be of some use:

.myObj = .something.new
[followed by things which give values to the variables in .myObj, 
including some dynamic variables, maybe]

Then the (built in) .save method could be used for:
.myObj.save "~/Custom/Stata/ado/A Nice Instance.inst"

Finally, the (built in) .open method could be used in another session for
.myObj = .something.open "~/Custom/Stata/ado/A Nice Instance.inst"

Similarly, there could be a (built in) .attach method which allowed

myvar.myObj = .something.attach

The one problem could come if .something were redefined between saves, I 
guess.

One use for this could be to have window positions of dialog boxes saved 
between sessions, so that people who are having trouble with the dialogs 
coming up underneath palettes (the review and variable windows) could 
have the positions of the boxes remembered from session to session.

Of course, this may be a very poor idea thought up by a novice object 
oriented programmer.

Bill
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index