Dealing with filenames in a folder...

Alex Tweedly alex at tweedly.net
Wed Oct 19 05:07:04 EDT 2005


Mark Smith wrote:

> You could just filter again
>
> filter ROMlist without ".*" -- no asterisk at the beginning limits  
> the filter to excluding lines that start with a period
>
I haven't followed all of this thread - so I may have missed something, 
but ...

I don't believe the problem is anything to do with the line ".DSstore" - 
that would be filtered out by the filter that excludes anything not a 
ZIP file, and I don't think another filter is needed.

I think the problem is the section

>   put the files into ROMlist
>   filter ROMlist with ".zip"

That filter command should be
filter ROMlist with "*.zip"

I suspect it's currently filtering out everything, and so giving the 
impression that everything stops.

> On 18 Oct 2005, at 22:07, Ian Leigh wrote:
>
>> I am, as an attempt to learn Dreamcard, writing a frontend to MAME.  
>> I have a fair idea of what I need to do, just doing it is a bit of  a 
>> struggle at the moment.
>>
>> The user points to where their ROM folder is. What I then need to  do 
>> is take each filename that ends with .ZIP and convert that into  a 
>> full title. At the moment I am cross referencing the filename  with a 
>> text file containing the information I need. Displaying the  
>> filenames in a field is easy using the files command and filter to  
>> find the .zips. Because the filename isn't very descriptive I want  
>> to use the descriptions in the text file instead.
>>
>> So far I have been trying the following....
>>
>> global allgamedata, ROMlist, ROMtitlelist
>>
>> on mouseUp
>>   local counter, titletoscan, n
>>   answer folder "Where are your ROMs?"
>>   put it into field "ROMlocation"
>>   set the defaultfolder to field "ROMlocation"
>>   put the files into ROMlist
>>   filter ROMlist with ".zip"
>>   put ROMlist into field "gamedescription"
>>   repeat with n = 1 to the number of lines in ROMlist
>>     put line n of ROMlist into titletoscan
>>     put titletoscan into field "filetoscan"
>>     add scantitle(titletoscan) to ROMtitlelist
>>   end repeat
>>   put ROMtitlelist into field "availablegames"
>>
>> end mouseUp
>>
>> function scantitle titletoscan
>>   local gametitle, returnedpos
>>   put lineoffset("$info=" & titletoscan, allgamedata) into returnedpos
>>   put line returnedpos + 2 of allgamedata into gametitle
>>   return gametitle
>> end scantitle
>>
>> The problem is that the first item in ROMlist is .DSstore and the  
>> whole thing seems to stop there. I could do with a little help if  
>> anyone can assist!
>>
>> I have been thinking perhaps I should take the filename one at a  
>> time and then create an array to store each game into but don't  know 
>> if that is really necessary in rev. The reason this has to be  done 
>> is that MAME supports many thousands of roms but the user may  only 
>> have a handful.
>>
>> Many thanks
>>
>> Ian
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>


-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.12.4/142 - Release Date: 18/10/2005




More information about the Use-livecode mailing list