Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2008
    Location
    Kansas
    Posts
    3

    list files contained in a folder via list box?

    Let me start by saying I am not a programmer just a self leaner. I am test driving AutoPlayMedia Studio 7.0 in researching it as the software to use for building autorun cds for various projects. One of the things I must be able to do is show in a list the files contained in a folder, select one or multiple files (like a pdf) and have it open in the appropriate reader window. I can't figure out which action to use for showing the file names in a folder as a means to populate a list of some sort.

    Any help, suggestions, example code etc would be wonderful.

    thanks
    hereisjoy

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    heres a function i use all the time to add a folder of files to a listbox

    place this function in the global area
    Code:
    -- FolderToListbox(string Object, string Folder, boolean Recurse, tabel Filters)
    -- adds the files with the filters to a listbox
    function FolderToListbox(strObject,strFolder,bRecurse,tbFilters)
    	for index, strExt in tbFilters do
    		tbFile = File.Find(strFolder, strExt, bRecurse, false, nil, nil);
    		if tbFile then
    			for index, strPath in tbFile do
    				local sPath= String.SplitPath(strPath);
    				ListBox.AddItem(strObject, sPath.Filename, strPath);
    			end
    		end
    	end
    end

    when you want to fill your list call the function like:
    Code:
    FolderToListbox("ListBox1", "AutoPlay\\Docs", false, {"*.mp3","*.wma"})
    hope that helps
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    Apr 2008
    Location
    Kansas
    Posts
    3
    I will try it. Thanks so much for your help.

Similar Threads

  1. list files contained in a folder via list box?
    By hereisjoy in forum AutoPlay Media Studio 7.5
    Replies: 0
    Last Post: 04-25-2008, 02:28 PM
  2. multiple locations.
    By wasim21k in forum AutoPlay Media Studio 6.0
    Replies: 15
    Last Post: 04-04-2007, 09:43 AM
  3. INFO: Why Files are Renamed in the DATA Folder
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-24-2002, 03:36 PM
  4. HOWTO: Set up an MP3 Playlist
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-24-2002, 11:57 AM
  5. HOWTO: Display Conditional Text Based Upon a List Box Selection
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-15-2002, 10:54 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