The opposite of Opendialog.filter ? lazarus / 31-LCL ---------------------------------------------------------------------- Elmug · 2011-08-26 19:27 Good people, I got the use of  the filter for opendialog already, from threads in this forum. However, I have use for the opposite mechanism, meaning that I want to filter-OUT, rather than filter-IN certain file extensions, for instance .exe files. Is this possible, and how? I hope so. Thanks! (I already tried the NOT statement, but overloading was not allowed). ---------------------------------------------------------------------- mas steindorff · 2011-08-27 01:57 mmm tricky... or not: you can add several file ext to one line of the filter to display different just the different types IE filter '*.txt;*.csv" too show just the two types. but that is not what you asked you say . I believe the only way is to prescan the dir to be shown by code and then add the "not in the not list" files to the open dialog at run time. before you call the xxx.execute code.  I'm not sure how but it shouldn't be that bad. getting it's default folder may be the only tricky thing to do for this approach. ---------------------------------------------------------------------- Elmug · 2011-08-27 06:38 Quote from: mas steindorff on August 27, 2011, 03:57:26 ammmm tricky... or not: you can add several file ext to one line of the filter to display different just the different types IE filter '*.txt;*.csv" too show just the two types. but that is not what you asked you say . I believe the only way is to prescan the dir to be shown by code and then add the "not in the not list" files to the open dialog at run time. before you call the xxx.execute code.  I'm not sure how but it shouldn't be that bad. getting it's default folder may be the only tricky thing to do for this approach. ---------------------------------------------------------------------- Elmug · 2011-08-27 06:46 Quote from: mas steindorff on August 27, 2011, 03:57:26 ammmm tricky... or not: you can add several file ext to one line of the filter to display different just the different types IE filter '*.txt;*.csv" too show just the two types. but that is not what you asked you say . I believe the only way is to prescan the dir to be shown by code and then add the "not in the not list" files to the open dialog at run time. before you call the xxx.execute code.  I'm not sure how but it shouldn't be that bad. getting it's default folder may be the only tricky thing to do for this approach. Thanks for the reply, Mas. I would have done what you say, but my need is also TO ALLOW the reading of files WITHOUT extension! The idea is to have a bunch of files with short names an no extension, so they don't overrun the boxes where the filename is to appear, ever. AND, to place those short-name files in the SAME directory of the application, so only the .exe is NOT to filter in. And the user can if want-to also put extensions to the filenames..Up to the user. Yet, NO subdirectory, nor drive letters would be there. By technical thinking, everytime you have a filter-through there is always a need for a filter-out. So maybe this ought to be considered for future capabilities of FP/Lazarus? But will manage some thing out, though. LIke maybe suggest the .exe be Read/only always. ---------------------------------------------------------------------- User137 · 2011-08-27 09:29 Filter for files without extension should be "*." If you were talking about coding way, there is also function DirectoryExists or DirectoryExistsUTF8 than can tell if given file with no extension is file or folder. ---------------------------------------------------------------------- Elmug · 2011-08-27 14:39 Quote from: User137 on August 27, 2011, 11:29:18 amFilter for files without extension should be "*." If you were talking about coding way, there is also function DirectoryExists or DirectoryExistsUTF8 than can tell if given file with no extension is file or folder. Thanks User137. This is a good tip. I still want to block the .exe, mainly. But I won't pursue this much more. Thanks!