Page 1 of 1
Annotating complex Visual Filters
Posted: 23 Mar 2010 19:31
by aurumdigitus
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?
Re: Annotating complex Visual Filters
Posted: 23 Mar 2010 19:52
by TheQwerty
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.
Re: Annotating complex Visual Filters
Posted: 23 Mar 2010 20:07
by aurumdigitus
You approach is innovative and yes does get the job done. Unless and until Don replies it will suffice.
Re: Annotating complex Visual Filters
Posted: 23 Mar 2010 20:23
by admin
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?
Not being a RegExp expert: Would
// at the end of the line be safe (non-ambiguous) with all sorts of RegExp filters?
Re: Annotating complex Visual Filters
Posted: 23 Mar 2010 20:49
by aurumdigitus
Admin wrote:Not being a RegExp expert: Would // at the end of the line be safe (non-ambiguous) with all sorts of RegExp filters?
Not being RegExp gifted either that's why left open the door to
similar approach, i.e. some other symbol or character.
Re: Annotating complex Visual Filters
Posted: 23 Mar 2010 21:23
by Gandolf
Another file manager uses the approach...
Code: Select all
GRAPHICS: *.bmp,*.gif,*.ico,*.jpe,*.jpeg,*.jpg,*.png
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.
Re: Annotating complex Visual Filters
Posted: 23 Mar 2010 22:22
by Stefan
admin wrote: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?
Not being a RegExp expert: Would
// at the end of the line be safe (non-ambiguous) with all sorts of RegExp filters?
Did you mean 'Visual Filter' is an RegEx and you want to add an option to comment within that RegEx?
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
Re: Annotating complex Visual Filters
Posted: 24 Mar 2010 09:19
by admin
(?#comment) is already supported in all XY RegExps.
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):
Re: Annotating complex Visual Filters
Posted: 24 Mar 2010 10:34
by Stefan
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):
I think this is an good idea.
For the others, as I see now, one can already use
*.gif|*.png|*.jpg|//Show Images only comment
Re: Annotating complex Visual Filters
Posted: 24 Mar 2010 18:44
by aurumdigitus
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.
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!
