<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi all <br>
<br>
I have questions about SmartRefStream which I can't get to work... It's
actually to restore a smallwiki2 kernel on a newer version.
ReferenceStream is working properly but as the model as changed (2 new
instance variblables and a renamed one), I have to fix manually... <br>
(the difference between the 2 models are :<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tags in SW2Structure<br>
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; embedded in SW2Link<br>
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; and anchor in SW2InternalLink)<br>
<br>
So I'd like to use SmartRefStream mainly to learn how to store and read
object back...<br>
<br>
|stream|<br>
<br>
"save"<br>
|stream|<br>
stream := SmartRefStream fileNamed: 'MyKernel.obj'.<br>
stream nextPut: (SW2Kernel instances first root).&nbsp;&nbsp;&nbsp; &lt;- a root
wikiPage which is a tree...<br>
stream close."<br>
<br>
-&gt; creates a file (570ko) which I just can't read back... ??<br>
<br>
<i>I used</i><br>
stream := SmartRefStream fileNamed: 'MyKernel.obj'.&nbsp;&nbsp; <br>
<i>then...</i><br>
stream readInstance<br>
<i>or </i><br>
stream next<br>
<i>or</i><br>
...<br>
stream close <br>
<br>
-&gt;Error: attempt to index non-existent element...<br>
<br>
<br>
I did not add the convert method as said in the comment <br>
convertToCurrentVersion: varDict refStream: smartRefStrm<br>
Is it necessary ? as I d'ont really care if the new instance variables
are set to nil.<br>
Does someone see why I cant read it back ?<br>
<br>
<br>
Thanks<br>
C&eacute;drick<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>