Re: OnCreateFTPList Event

Giganews Newsgroups
Subject: Re: OnCreateFTPList Event
Posted by:  Don S (mudsha…
Date: Mon, 5 Jul 2004

> When does OnCreateFTPList event occur? Should it "fire" after List() ?

No.  It's gets fired when you access the DirectoryListing property and only when the DirectoryListing property is unassigned.  List frees any exisitng directory listing.  So, technically, OnCreateFTPList gets fired after List - and only when you access DirectoryListing.

> What should I do now to populate a TreeView with results from List;
> I know I can have a TStrings object as List() parameter but then I must
> parse that list result myself. I know there are several parsers available
> and I wanted to know what the best way would be.

OnCreateFTPList is not going to be of much help in filling a tree or list view... there are no items in the directory listing yet.  It's fired only when  the collection is created... not filled.

Why not just check the DirectoryListing property (which forces it to be parsed), and fill your tree or list view if there are items?  For example:


if DirectoryListing.Count > 0 then




In response to

OnCreateFTPList Event posted by Luis Mineiro on Mon, 05 Jul 2004