Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getNthFileNameInFolder

Status
Not open for further replies.

Digidude

IS-IT--Management
Nov 4, 2001
3
US
Has anyone used this command in lingo? Any help on how it works or how to get the list from a particular directory would be helpful.

dd
 
you give it a path and number and it gives you the filename of that file.
eg
filename = getnthfilenameinfolder(the moviepath, 5) would give you the name of the 5th file in that folder and put it in variable filename

there is a code example of how to go through all files in a folder in the lingo dictionary.
 
Ok, Let's take this a step further then.

I need someone to help me with the code for this problem. I know what is needed for the most part, I'm just not familiar enough with the lingo to do it myself. Please help if you can...

Here is what I want to do. I want to play several movies in a particular order and chose a random movie depending on the play order, that is pulled from individual directories. As an example... I have several directories that would determine the order of the play list - Sports, Comics, Music, Food, Love. For each category, there would be a folder or directory in Windows. The categories would play in the order specified, and at each category, it would pull a random file out of that particular folder. So, the program would get to the Sports folder, create a list of all .swf movie files within that folder, save the list to a file in that folder, and then randomly select one of the swf movies in the directory and play it. This would then repeat for each category, comics, music, food... etc. It would look something like this:

Sports Folder = Sports1.swf, Sports2.swf, Sports3.swf
Comics Folder = Comics1.swf, Comics2.swf, Comics3.swf
Music Folder = Music1.swf, Music2.swf, Music3.swf
Food Folder = Food1.swf, Food2.swf, Food3.swf
Love Folder = Love1.swf, Love2.swf, Love3.swf

Again, the program would create the list based on everything in that folder... must likely using the getNthFileNameInFolder command. It would then convert the list from string to text and write the text file into that directory. So the sports folder would have sportslist.txt as an example.

Once the list is done, if new movies are added into the directory or folders, when the projector is run again, it would create a new list. So for instance if Comics22.swf was added, it would automatically be included in the play list upon writing to the text file.

This portion is now done, from there, On each category, I'd call up the text file, select a random file from each list and play it. So the final output would look something like :

Sports1.swf - Comics3.swf - Music2.swf - Food2.swf - Love1.swf - loop

Hopefuly I've given enough info for someone out there to help me put this code together. Any help is appreciated and can be mailed to me at atomicrhino@hotmail.com

Thanks in advance...

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top