Select Files and Folders of Different Extensions

Hello ,
OK, I promise I'll laugh if anyone can write a DOpus function that accomplishes this.

It was a dark rainy, rainy cold day here and I had nohing better to do.
I wrote a C++ command line program that selects folders and files of different extensions,
but with the same exact root name as the file selected.
I also escaped DOpus Pattern Matching Syntax in the process.
Without doing so, files containing characters such as (, ), [, ], ~, #, and ' are not properly selected.
A filter can be written for a specific case, but I hoped this to be perhaps an on the fly method.

It's a little slow yet, but cleaning up the code some might help it out.
One simply selects a file or folder,
and all other files and folder with the same root name are then selected by the program.

The button is just :
runmode hide
Yourpath\RootSelect.exe 5000 {sourcepath|noterm} {o}

The 5000 is just a dummy number at this point.
It will be eliminated from the final program if it gets that far.
It sets a limit to the number of files and folders in a directory it will gather data about.
The maximum is set internally at 20,000 .

A very early working beta can be downloaded here.

:opussanta: porcupine

Late Edit Note:
I think I can quite significantly improve the speed of this.
With just a little rethinking and rewriting the select can be done all at once as a pattern.

It was an equally dark and rainy, rainy, and rather rainy night and a weary steje recalled the porcupine asking Santa Claus for a way of disabling/escaping Opus Pattern Matching Syntax... LOL.

I fixed a small bug that prevented proper file selection if the first character of the file or folder was one of (, ), [, ], ~, #, or ' .

The new beta can be downloaded here.

:opussanta: porcupine

Well it works much, much faster and better now.
I also realize that a pattern of (.*|) could have been used for the extensions, but it's been an interesting excercise !
It's a template for future use.

I think I have all the weird bugs out now ( how to do case insensitive string comparisons comes to mind :bulb: ).
It will run even faster when I clean up the code a bit.
The new beta can be downloaded here.

:opussanta: porcupine

For what it's worth, if anyone at all is interested, I fixed one last bug.
The program did not select files with no extension.
HP Calculator files are of this nature.

The new beta is here.

That's about the end of this.
The idea might prove useful in the future. :laughing:

:opussanta: porcupine