Board index » delphi » String := MemoryStream

String := MemoryStream

Hi,

How can I put everything in a ListBox (Listbox1) into a MemoryStream
(Stream1), and then clear the listbox and put everything in the MemoryStream
back into the listbox?

Thanks!

 

Re:String := MemoryStream


use a TStringStream. for example:

var loopint:integer;
    Buf:ansistring;
    Tempstream:TStringStream;
 begin
    listbox1.items:=Screen.fonts;
    Tempstream:=TStringStream.Create(listbox1.items.commatext);
    listbox2.Items.commatext:=Tempstream.DataString;
end;

Good luck!!
-DrDelphi

http://www.drdelphi.com

Quote
"Jack" <j...@fantasyisp.com> wrote in message

news:397831e5@news.jakinternet.co.uk...
Quote
> Hi,

> How can I put everything in a ListBox (Listbox1) into a MemoryStream
> (Stream1), and then clear the listbox and put everything in the
MemoryStream
> back into the listbox?

> Thanks!

Other Threads