Jump to content

inverse filters for FileOpenDialog ?


kev51773
 Share

Recommended Posts

If you mean that it has to show all files... you could use

"All (*.*)"

As filter.. than it`ll show all files/folders.

Neo

No, what I mean is I have a list of files in a directory as follows

0001.file

0002.file

0003.file

0004.file

00_blah_04.file

0005.file

00_blah_05.file

Basically I want the FileOpenDialog to display the 000*.file files and not the ones with _blah_ in the name.

Link to comment
Share on other sites

$search = FileFindFirstFile("000*.*")  

If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf

While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop
    
    MsgBox(4096, "File:", $file)
WEnd

FileClose($search)


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

$search = FileFindFirstFile("000*.*")  

If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf

While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop
    
    MsgBox(4096, "File:", $file)
WEnd

FileClose($search)
Unfortunately, that wont work. I need to allow the user to select a file from a choice of everything in a directory that doesnt contain _blah. Also I got the format of my files slightly wrong. They are more like...

0001.file

0002.file

0002_blah.file

0003.file

0003_blah.file

Link to comment
Share on other sites

Sorry for the shameless bump, but does anyone have any idea how to work around this problem....

It is a M$ function inside a dll so all you can do is feed parameters that it expects. What you ask for is not what the function expects. My opinion, unless you want want to recreate this standard function..., then you do not have the option to inverse with this function.

FileOpenDialog at the moment cannot inverse the display unless something magical happens. Magic can happen though do not expect it.

Link to comment
Share on other sites

What BigDod gave you is what you'll need to use adding your filter to the information found.

Then put the data in a GuiCombo or GuiList and let the user make a choice.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...