Reading Dictionary from File

Andreas Raab raab at isgnw.CS.Uni-Magdeburg.De
Sat Dec 5 15:46:37 UTC 1998


> I think I must be missing something really simple here!

You're right. The magic line of code is:

  Object readFrom: (FileStream readOnlyFileNamed:'myFile').

Object class>>readFrom: is the counterpart of #storeOn: If you know a
little more about the object then you can delegate it to the appropriate
subclass (look for the implementors of #readFrom:). Note that #readFrom:
is generally a class method since there is no instance of the object to
read yet - this might have confused you in the first place.

Hope this helps,
  Andreas
-- 
Linear algebra is your friend - Trigonometry is your enemy.
+===== Andreas Raab ============= (raab at isg.cs.uni-magdeburg.de) =====+
I Department of Simulation and Graphics      Phone: +49 391 671 8065  I
I University of Magdeburg, Germany           Fax:   +49 391 671 1164  I
+=============< http://isgwww.cs.uni-magdeburg.de/~raab >=============+





More information about the Squeak-dev mailing list