Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3

Thread: ftp problem

  1. #1
    Join Date
    Oct 2006
    Location
    Somewere over the rainbow
    Posts
    314

    Grin ftp problem

    hi, i;ve got a little problem.. can someone tell me why the name of the file/folder does not get set as the data in the LB?

    Code:
    ftp_dir_index = FTP.List();
    
    -- add each item to the listbox in this format:
    -- <name> (<size>)
    for i = 1, ftp_dir_index.Count do
        local name = ftp_dir_index[i].Name;
        local size = ftp_dir_index[i].Size;
        local date = ftp_dir_index[i].Date;
    	ftp_file_info = FTP.GetFileInfo(name);
    	
        if ftp_dir_index[i].Type == FTP.FOLDER then
            -- add a [ ] prefix to make the folders stand out in the listbox
            ListBox.AddItem("ftp_dir_index", "[ FOLDER ]  "..name.."      ("..size.." bytes) ", name);
    
        else
            ListBox.AddItem("ftp_dir_index", "[  FILE  ]  "..name.."      ("..size.." bytes) ", name);
        end
        ListBox.SetUpdate("ftp_dir_index", true);
    end

  2. #2
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    Hmm well it seems to be working for me on the FTP site I tested with.

    Try adding this to your 'On Select' actions for the listbox. It will tell you the data field when you click on it. Again, it appears to work for me. Not sure if it's a problem with your connection to the FTP server since I'm assuming you can see the listbox being populated, right?

    Code:
    tSelected = ListBox.GetSelected("ftp_dir_index");
    for index in tSelected do
    	Dialog.Message("Listbox Data Field", ListBox.GetItemData("ftp_dir_index", tSelected[index]), MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    end

  3. #3
    Join Date
    Oct 2006
    Location
    Somewere over the rainbow
    Posts
    314
    Quote Originally Posted by Tek View Post
    Not sure if it's a problem with your connection to the FTP server since I'm assuming you can see the listbox being populated, right?
    [/code]
    yeah it does get populated.. i've made the listbox change the text of a label to the itemdata on double click and it went blank.. your little solution worked

    thanks, Tristan

Similar Threads

  1. Ftp login problem
    By mrdude in forum AutoPlay Media Studio 5.0
    Replies: 14
    Last Post: 04-05-2010, 07:12 AM
  2. Secure FTP
    By TJ_Tigger in forum AutoPlay Media Studio 5.0
    Replies: 4
    Last Post: 08-19-2008, 04:46 PM
  3. Problem while downlodading with FTP
    By peter2003 in forum AutoPlay Media Studio 5.0
    Replies: 6
    Last Post: 07-26-2005, 01:45 PM
  4. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 08:38 AM
  5. FTP Problem
    By day10 in forum TrueUpdate 1.0
    Replies: 2
    Last Post: 05-28-2002, 10:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts