Filtering FIle Types

Peter M. Brigham pmbrig at gmail.com
Tue Sep 2 08:17:28 EDT 2014


you can use the following:

function filterByType pFileList, pType
   -- assuming pType is of the form "jpg" or "png"
   filter pFileList by ("*." & pType)
   return pFileList
end filterByType

and call it repeatedly for whatever file types you want.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig


On Sep 1, 2014, at 4:28 PM, JB wrote:

> I have not tried it yet but if it works
> the problem is I might want to use
> a variety of file types so the repeat
> would filter one line at a time and
> then you check for that type in the
> list of types you will allow.
> 
> The way you provided would need it
> to allow a list of types or I would need
> to keep filtering so there might be a
> faster way but I am not sure.
> 
> Thank you for the reply and code advice.
> 
> John Balgenorth
> 
> 
> On Sep 1, 2014, at 1:24 PM, Martin Koob <mkoob at rogers.com> wrote:
> 
>> 
>> I think you can use the filter command with a wildcard and your extension. 
>> Put your folder path into tMyFolderPath then:
>> 
>> set the folder to tMyFolderPath
>> put the files into theFiles
>> filter theFiles with "*.jpg"
>> 
>> Martin
>> 
>> 
>> 
>> --
>> View this message in context: http://runtime-revolution.278305.n4.nabble.com/Filtering-FIle-Types-tp4682777p4682778.html
>> Sent from the Revolution - User mailing list archive at Nabble.com.
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list