Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2006
    Posts
    175

    Grin Populate listbox from text file

    I have examined just about every listbox example that I can find and I am still stuck. What I want to do is populate a listbox from a text file. The text file will have two items per line.

    The first item in the line is the text that I want to appear in the listbox. The second item is the filename to be opened when the user double clicks the item [they all are either a pdf or doc file]. I can delimit the text file with any symbol and I have using a "|" as this was the easiest symbol to use from the sub-system that is generating the text file.

    Text File Example [myFiles.txt]:
    John Smith|12345.pdf
    Wilbur Wood|45433.doc
    Jane Doe|5677.pdf
    Martha Brown|56666543.doc


    I have figured out how to search for the "|" character using LUA....What I can't figure out is how to script that everything to the left of the "|" is the item to display in the text box and everything to the right of the "|" is the full file name.

    I know this is probably a stupid question, but after 5 hours of examining every lisbox that I could get my hands on....well, I still can't get it to work....Maybe I can't proceed using this logic process or I have made it much too complicated. Thanks for your patience...

  2. #2
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,539
    Hello,

    please have a look at the example I made for you.

    Ulrich
    Attached Files

  3. #3
    Join Date
    Apr 2006
    Posts
    175

    Smile

    Thank you very, very much....This certainly gets me started. I was using the String mid function, but I wasn't smart enough to add 1 or subtract 1 from the separator...Golly, I have much to learn. Thanks again.

  4. #4
    Join Date
    Apr 2006
    Posts
    175

    Grin File Path for text file

    upeters,
    I have a question regarding your example. When I populate the text file, how do I write the path to the file location? My application will end up on either a CD or a flash drive. I have no way of knowing what the assigned drive letter will be. So I need to "discover" how to write a "dynamic" path in the text file so that AutoPlay will find the file regardless of the assigned drive letter to the CD or flash drive in the end user's computer.

    I hope my question makes sense...I have been working on trying to make this work for the last six hours....I need to step away as I am missing the obvious...any advice is greatly appreciated. Take care.
    Waldo.
    Last edited by Waldo; 10-03-2008 at 02:01 PM. Reason: Correct typo

  5. #5
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,539
    Hello Waldo,

    when you publish your project, you will have a CD_Root folder with autorun.exe in it, and a folder called AutoPlay. Under this AutoPlay folder you will have subfolders for every type of file used in your project.

    Your documents could be placed in the Docs subfolder. In my former project I did not supply you with my original files, because those were my shortcuts for premium access to internet radio, and it was only an example... But in your case, it would make more sense to point to the Docs subfolder, and place there the files you are going to ship with your project.

    When building the path to the file, you may supress the drive letter, and the current drive will be assumed where autorun.exe is being executed. All you will have to do is correct the full path to the files. In my example, I will point to the Docs subfolder, like this:
    Code:
    Eurodance|AutoPlay\Docs\eurodance.pls
    I have modified my original example: Now it shouldn't matter where (on which drive letter) you run this example, by simply clicking one of the 16 music styles available in the ListBox, you should start hearing internet radio with that specific style (unless your registered media player is unable to handle the streaming format I have chosen).

    Ulrich
    Attached Files

  6. #6
    Join Date
    Apr 2006
    Posts
    175

    Smile

    upeters,
    Thank you for the example...I will spend my Sunday afternoon working to digest your example...I really do appreciate your efforts and posting this revised example file...thank you!!! Waldo

Similar Threads

  1. ListBox to Text File
    By AudioSam in forum AutoPlay Media Studio 6.0
    Replies: 13
    Last Post: 01-15-2007, 06:52 AM
  2. Formating a text or htm file HELP !!!!
    By lance in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 08-30-2005, 11:42 AM
  3. Example: Loading Paragraph Text Using a Timer
    By Jonas DK in forum AutoPlay Media Studio 5.0 Examples
    Replies: 7
    Last Post: 11-25-2004, 05:10 PM
  4. HOWTO: Create a Project Template
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-28-2002, 01:49 PM
  5. Replies: 0
    Last Post: 08-17-2000, 02:29 PM

Posting Permissions

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