You want to use a RegEx object. For example --
GetMatchingFiles(parent as FolderItem) as FolderItem()
if parent is nil then
dim noList(-1) as FolderItem
return noList
end if
dim theList(-1) as FolderItem
dim r as new RegEx
r.SearchPattern = "^temp....\.html$"
for i as Integer = 1 to parent.Count
if parent.TrueItem(i) is nil then
continue
end if
if parent.Directory then
continue
end if
if r.Search(parent.TrueItem(i).Name) <> nil then
theList.Append parent.TrueItem(i)
end if
next
return theList
End Function
Charles Yeomans
On Dec 13, 2006, at 5:33 PM, Ed Harris wrote:
As part of the solution for the CreateTextFile problem I posted a
couple of
days ago, I need an easy way to get a list of files in a folder
that match a
template, e.g., "temp????.html" where the ? is any single
character. It
needs to work on both Mac OS X and Windows.
What is the easiest way to do this? I can't figure it out from the RB
documentation.
I will explain the solution to my original problem once I can get
this file
list code to work in my application.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>