I am trying to do a directory search including subdirectories, but I can not get it to work.
I want to list all the Files and Directories that have the search test in there names
Here is the Function that I call.
Code: Select all
Function p_SearchDir(SearchDir$)
sd = OpenDirectory(NIL,SearchDir$)
Entry = NextDirectoryEntry(sd)
While Entry <> 0
If Entry.type = #DOSTYPE_FILE
If FindStr(Entry.name,SearchString$,False) > -1
mui.DoMethod("ListSearch","Insert","Bottom",Entry.name)
Endif
Endif
If Entry.type = # DOSTYPE_DIRECTORY
NSearchDir$ = SearchDir$..Entry.name
p_SearchDir(NSearchDir$)
mui.DoMethod("ListSearch","Insert","Bottom",Entry.name)
Endif
Entry = NextDirectoryEntry(sd)
Wend
CloseDirectory(sd)
EndFunction
I get an Error Requested object not found.
Thanks