Board index » delphi » Help with TStream and Run-time Error 210

Help with TStream and Run-time Error 210

I am having trouble using streams.  I need to store
the contents of a memo field in memory for a while.
Unfortunately, I get a Run-time error 210 when
I execute my code.  This error is useless to me, because
I can't find any help for run-time errors in the
online help facilities.  The following code is just
to demonstrate the error.  But if there is a better way
to store memo fields in memory dynamically, I'd love to
hear it.

To duplicate the error:  
add 2 memo fields to a form.  On a button_click, try the
following code:
  stream : TStream;
  stream := TStream.create;

Thanks in advance for any help,
Eric J. Lannert
Northwestern University, Evanston, IL.   USA


Re:Help with TStream and Run-time Error 210


Maybe the following will solve the problem,

>  stream : TStream;

  Stream : TMemoryStream;

>  stream := TStream.create;

  stream := TMemoryStream.Create;

>  memo1.lines.savetostream(stream);

{ Reset position of stream to zero }
  Stream.Position := 0;

>  memo2.lines.loadfromstream(stream);

I'm not sure if it works but you also could try to use Assign method to copy
one memo field to another:


I've never done anything with memo so again I'm not sure the above would work.

Hope this helps a little bit,

Josha Munnik.

I-ViSaGE               |  "The guide says there is an art to
Josha Munnik           |  flying," said Ford, "or rather a knack.   |  The knack lies in learning how to throw
tel: +31-(0)74.502953  |  yourself to the ground and miss."
fax: +31-(0)10.4769477 |  
_______________________|  (The Hitchhikers guide to the Galaxy)

Other Threads