First you need to find all the files in a specific directory
` Change Directory
CD "(directory)"
` Find files
Perform checklist for files
Then you need to extract each file name from the list, parse the extension from the file name, filter files, and save to an array.
`Make temporary array to save names
Dim filename$(checklist quantity())
` Specify filter type
filter$ = "bmp"
For f = 1 To checklist quantity()
` Get file name
f$ = checklist string$(f)
` find file extension
For x = 1 To len(f$)
If mid$(f$,x) = "."
ext$ = right$(f$,len(f$)-x)
Exit
Endif
Next x
If ext$ = filter$
inc valid
filename$(valid) = f$
Endif
Next f
`Make array to save valid file names
Dim files$(valid)
`Save into array
For x = 1 To valid
files$(x) = filename$(x)
Next x
` Delete old array
Undim filename$(0)
Now you have an array full of the names of all files that have the extension of the filter.
Now use this code to see the contents of the array:
For x = 1 To valid
Print files$(x)
Next x
Wait key
The only drawback of this code is if the file has a period in its name, it wont recognize it.
You can also search for files using Find first/ find next, but I like to do it this way.
Hope that helped.
"All programmers are playwrites and all computers are lousy actors" -Anon