Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2005
    Posts
    15

    Add to listbox from search string

    I am trying to search a folder for all files then list them in a list box when the page is shown.
    Code:
    findsource = File.Find("AutoPlay\\Koader Bin\\source", "*.", false, false, nil);
    ListBox.AddItem("sourcebox", findsource, "");
    It builds but I get the error:
    On Show, Line 12: Argument 2 must be of type string

    Not sure why findsource is not a string

    I had it done in Autoplay 4.0 and it looked like this:
    Code:
    File.Search ( %Files%, ;;, *, 0, 0, 0, 0, 1, %SrcDir%\AutoPlay\Koader Bin\source, 0, Searching for Files, Loading List of available programs, 0 )
    ListBoxObject.AddFiles ( Installers, 0, , %Files%, ;;, 2, 1 )
    File.Search ( %zipfiles%, ;;, *, 0, 0, 0, 0, 1, %SrcDir%\AutoPlay\Koader Bin\zip\, 0, Searching for Files, Loading List of available programs, 0 )
    ListBoxObject.AddFiles ( zip, 0, , %zipfiles%, ;;, 2, 1 )
    - Any help .. point me in the right direction or something?
    Thank you
    Nirus

  2. #2
    Join Date
    Feb 2005
    Posts
    15
    when I try:

    Code:
    findsource = File.Find("AutoPlay\\Koader Bin\\source", "*.", false, false, nil);
    ListBox.AddItem("sourcebox", "\findsource", "");
    The list box has 1 value that says:
    indsource

    but there is a box or an unknown character or whatever you want to call in it infront of indsource

    -Brent

  3. #3
    Join Date
    Feb 2005
    Posts
    15
    When I try recurseing I get the same thing... indsource.

    Not sure If I need to be recursing or not. I am not searching subfolders

    -Brent

  4. #4
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Brent, in AMS 5 the variable you have assigned to the Find.Files action returns a table. For example, to get at the first row of data (index and data) you can use this synatx:

    findsource[1]

    ... the [n] represents a row in the table that is index starting at the number 1, and then increments by one by default from there.

    To get all the files you need to setup a loop to work with the table that is findsource

    The help section (F1) in AMS 5 can give you some examples, you can find some on this forum via way of the Search link (see it up and to the right on this page), and you can check over at amsuser.com, which is a site I created that stores in an easy to access (and free, like here) list of projects mostly culled from this site and those gracious enough to share freely their small projects. Where at least one has an example I am sure will help.

    Sincerely,
    Intrigued

  5. #5
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Brett from IR posted an example that may be very useful for you to look at.

    http://www.indigorose.com/forums/sho...light=explorer

  6. #6
    Join Date
    Feb 2005
    Posts
    15
    ahhh... So it returns it in an array. This will explain a lot

    Now all I need to do is find some type of for each. Maybe I can do sometype of get_file.findmaxnum to find the total number of items and then loop through them stepping I by 1. Thanks for the help. Ill check out that example.

    Much appriciated
    Brent

  7. #7
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    nirus, take a look at this I.R. member's example. It shows you how to do this very thing.

    http://www.indigorose.com/forums/sho...+files+listbox

    Intrigued

  8. #8
    Join Date
    Dec 2003
    Posts
    891

    try this

    Here is a quick one to populate list box from a folder, if that is all you want to do.
    Attached Files

Similar Threads

  1. about listbox search
    By quinquagesima in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 05-09-2008, 05:58 PM
  2. search in a listbox
    By Ruud Jonk in forum AutoPlay Media Studio 5.0
    Replies: 20
    Last Post: 12-16-2004, 12:18 AM
  3. Replies: 2
    Last Post: 01-13-2003, 01:00 AM
  4. string search & replace
    By antjedi in forum AutoPlay Media Studio 4.0
    Replies: 5
    Last Post: 10-22-2002, 11:02 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