|
Re: what's the existing projects to save objects?: msg#00111lang.smalltalk.squeak.beginners
Hi, I search to save an object (and the objects which possibly "Create your object(s)" myObject _ {'abc' . 3 . $g}. "Open a ReadWriteStream (not a simple WriteStream, because of a bug?)" fileStream _ FileStream forceNewFileNamed: 'myObject.obj'. "Open a ReferenceStream on your ReadWriteStream" serializeStream _ ReferenceStream on: fileStream. "Use #nextPut: and #nextPutAll: to put all your objects into the " "reference stream." serializeStream nextPut: myObject. "Close the streams" serializeStream close. fileStream close. "Here are the steps to get your objects back" fileStream _ FileStream fileNamed: 'myObject.obj'. serializeStream _ ReferenceStream on: fileStream. myObject2 _ serializeStream next. "Use #next to get your objects back." serializeStream close. fileStream close. Bye -- Damien Cassou
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: what's the existing projects to save objects?, Mathieu SUEN |
|---|---|
| Next by Date: | Tab navigation, Mathieu SUEN |
| Previous by Thread: | Re: what's the existing projects to save objects?, Mathieu SUEN |
| Next by Thread: | Re: what's the existing projects to save objects?, Mark Aufflick |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |