Save listitems to file!

Hi experts:
I want to find a easy way to save my listitems(i use listview component)to file as they show to me.Listview items are dynamic and i want to show 50 items on screen.
mingweiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jeurkCommented:
Hi,
use the rxlib (www.rxlib.com)
in it, the component called formstorage.
Drop it on the form. Double click on
it. select your listview and the items
property.
It will automaticaly save you items
even those added dynamically.
This is an easy answer, if you are using
that library ;)
0
men xinCEOCommented:
mingwei

I think it is not defficult,i can give you some lines...

var i:integer;
begin
  ListView1.Items.Clear;
  for i:=0 to Memo1.Lines.Count-1 do
    with ListView1.Items.Add do
      Caption:=Memo1.Lines[i];
  Memo1.Clear;
  ShowMessage('load listview.itemscaption to memo.');
  for i:=0 to ListView1.Items.Count-1 do
    Memo1.Lines.Add(ListView1.Items[i].Caption);
    Memo1.Lines.SaveToFile('c:\listitems.txt');

Of couse,it is not easy such this if you use subitem...,but it is not defficult....


Good luck

menxin
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mingweiAuthor Commented:
It works anyway!Thank!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.