While recently doing an involved operation it become necessary to construct several intricate Visual Filters. It would have been very handy to have been able to Comment them with a // at the end of the line as with Scripts.
Could this or a similar approach be implemented?
Annotating complex Visual Filters
-
aurumdigitus
- Posts: 1075
- Joined: 30 May 2008 21:02
- Location: Lake Erie
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
Re: Annotating complex Visual Filters
You could always turn your filter into a script and use string concatenation to construct the filter over multiple lines and with comments.
It may not be elegant but it would get the job done.
It may not be elegant but it would get the job done.
-
aurumdigitus
- Posts: 1075
- Joined: 30 May 2008 21:02
- Location: Lake Erie
Re: Annotating complex Visual Filters
You approach is innovative and yes does get the job done. Unless and until Don replies it will suffice.
-
admin
- Site Admin
- Posts: 66360
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Annotating complex Visual Filters
Not being a RegExp expert: Would // at the end of the line be safe (non-ambiguous) with all sorts of RegExp filters?aurumdigitus wrote:While recently doing an involved operation it become necessary to construct several intricate Visual Filters. It would have been very handy to have been able to Comment them with a // at the end of the line as with Scripts.
Could this or a similar approach be implemented?
FAQ | XY News RSS | XY X
-
aurumdigitus
- Posts: 1075
- Joined: 30 May 2008 21:02
- Location: Lake Erie
Re: Annotating complex Visual Filters
Not being RegExp gifted either that's why left open the door to similar approach, i.e. some other symbol or character.Admin wrote:Not being a RegExp expert: Would // at the end of the line be safe (non-ambiguous) with all sorts of RegExp filters?
-
Gandolf
Re: Annotating complex Visual Filters
Another file manager uses the approach...
where the name (or, in your case, description) of the filter is to the left of the colon, and the filter to the right. I think I mentioned this somewhere else in the forum long ago.
Code: Select all
GRAPHICS: *.bmp,*.gif,*.ico,*.jpe,*.jpeg,*.jpg,*.png-
Stefan
- Posts: 1360
- Joined: 18 Nov 2008 21:47
- Location: Europe
Re: Annotating complex Visual Filters
Did you mean 'Visual Filter' is an RegEx and you want to add an option to comment within that RegEx?admin wrote:Not being a RegExp expert: Would // at the end of the line be safe (non-ambiguous) with all sorts of RegExp filters?aurumdigitus wrote:While recently doing an involved operation it become necessary to construct several intricate Visual Filters. It would have been very handy to have been able to Comment them with a // at the end of the line as with Scripts.
Could this or a similar approach be implemented?
Then try (?#comment)
http://www.regular-expressions.info/comments.html
inline modifier (?x).
http://www.exampledepot.com/egs/java.ut ... mment.html
``the /x modifier'',
http://www.perl.com/doc/manual/html/pod/perlre.html
-
admin
- Site Admin
- Posts: 66360
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Annotating complex Visual Filters
(?#comment) is already supported in all XY RegExps.Stefan wrote:Did you mean 'Visual Filter' is an RegEx and you want to add an option to comment within that RegEx?admin wrote:Not being a RegExp expert: Would // at the end of the line be safe (non-ambiguous) with all sorts of RegExp filters?aurumdigitus wrote:While recently doing an involved operation it become necessary to construct several intricate Visual Filters. It would have been very handy to have been able to Comment them with a // at the end of the line as with Scripts.
Could this or a similar approach be implemented?
Then try (?#comment)
http://www.regular-expressions.info/comments.html
inline modifier (?x).
http://www.exampledepot.com/egs/java.ut ... mment.html
``the /x modifier'',
http://www.perl.com/doc/manual/html/pod/perlre.html
In other contexts (POM, Favorites) we can have quoted captions at the beginning of the item, so why not here? The caption/comment would be preprended to the VF as "Caption" (incl the quotes and followed with a space!).
Now, consequently should the tab caption show just the VF caption (if there is any)? Like this (for a filter "images" *.gif|*.png|*.jpg):
To see the attached files, you need to log into the forum.
FAQ | XY News RSS | XY X
-
Stefan
- Posts: 1360
- Joined: 18 Nov 2008 21:47
- Location: Europe
Re: Annotating complex Visual Filters
I think this is an good idea.admin wrote: Now, consequently should the tab caption show just the VF caption (if there is any)? Like this (for a filter "images" *.gif|*.png|*.jpg):
For the others, as I see now, one can already use
*.gif|*.png|*.jpg|//Show Images only comment
-
aurumdigitus
- Posts: 1075
- Joined: 30 May 2008 21:02
- Location: Lake Erie
Re: Annotating complex Visual Filters
How that the code has appeared in Beta with near the speed of light hopefully others in addition to Don and myself will find it a useful adjunct!v8.90.0014 - 2010-03-24 14:00
+ Visual Filters: Now you can prepend a caption to each filter item. The syntax is similar to the one you know from Favorites or the POM, only that the quoted caption must be followed by a space character to avoid ambiguities.
For example:
"Images" *.gif|*.png|*.jpg
"Items ending with g" >g$
The tab captions will show only the (unquoted) caption of a VF with caption.
XYplorer Beta Club