How to use SmartRefStream

Germán S. Arduino gsa at softhome.net
Mon Aug 16 13:35:29 UTC 2004


Hi:

I've a model with only one instance in the image and I backup this model
with:

| rr |
rr := SmartRefStream fileNamed: 'MyModel.obj'.
rr nextPut: MyModel someInstance.
rr close.

But I can't figure out how to read again inside the image, I've tried,
between several attempts,:

| rr |
rr := SmartRefStream fileNamed: 'MyModel.obj'.
MyModel allInstances do: [:each1 | each1 := rr next].
rr close.

I'm sure that I've only one instance in the model (worked with Seaside and
Mewa) but I can't figure out how to recover the data in the file
'MyModel.obj' to rebuild my objects in the image.

The previous MyModel allInstances do: [:each1 | each1 := rr next] fails with
'attempt to index non-existent element in an ordered collection'.

I can't imagine how to replace the "data" of my live instance of MyModel
with the data saved in the external file "MyModel.obj".

Any help will be appreciated.

gsa.








More information about the Squeak-dev mailing list