Page 1 of 1
filter script
Posted: 12 Feb 2008 00:38
by graham
If this isn't a bug then it is confusing
Using the VF without script in normal use to get a filter for say *.txt and *.exe seems to require VF set as *.txt;*.exe
eg C:\Program Files\XYPlorer|*.txt;*.exe
gives me what I wante (seems wrong to me)
Same used in a script does not give this result
Is this a bug or is an incompatability?
Re: filter script
Posted: 12 Feb 2008 02:09
by jacky
graham wrote:eg C:\Program Files\XYPlorer|*.txt;*.exe
gives me what I wante (seems wrong to me)
Why does it seem wrong ? It's exactly what it should be, and as been ever since VF were made I believe.
And what doesn't work in script ? works fine here, eg: ::filter "*.txt;*.exe" (with 6.80.0070, new syntax)
Posted: 12 Feb 2008 02:52
by graham
graham wrote:
eg C:\Program Files\XYPlorer|*.txt;*.exe
gives me what I wante (seems wrong to me)
Why does it seem wrong ? It's exactly what it should be, and as been ever since VF were made I believe.
And what doesn't work in script ? works fine here, eg: ::filter "*.txt;*.exe" (with 6.80.0070, new syntax)
Thanks you have sorted it out for me.
What seems wrong is the use of an end of command ; being used within a normal filter statement (in this case) and then the need to use quotes for a script to contain them. I think that is not the best way and looks like a fudge. Possibly the use of ; in the visual setting should be changed to some other so that ; is reserved for scripting command separation.
Ok you can have the rules to obey but this just seems to be one rule that could be avoided.
Posted: 12 Feb 2008 08:41
by admin
graham wrote:graham wrote:
eg C:\Program Files\XYPlorer|*.txt;*.exe
gives me what I wante (seems wrong to me)
Why does it seem wrong ? It's exactly what it should be, and as been ever since VF were made I believe.
And what doesn't work in script ? works fine here, eg: ::filter "*.txt;*.exe" (with 6.80.0070, new syntax)
Thanks you have sorted it out for me.
What seems wrong is the use of an end of command ; being used within a normal filter statement (in this case) and then the need to use quotes for a script to contain them. I think that is not the best way and looks like a fudge. Possibly the use of ; in the visual setting should be changed to some other so that ; is reserved for scripting command separation.
Ok you can have the rules to obey but this just seems to be one rule that could be avoided.
Well, using quotes to handle those cases was more or less the whole point in changing the syntax of scripting. I don't know what a fudge is, but I know that quotes in this context are the standard way.
Posted: 12 Feb 2008 21:24
by graham
Well, using quotes to handle those cases was more or less the whole point in changing the syntax of scripting. I don't know what a fudge is, but I know that quotes in this context are the standard way.
Admin:
I fully understand. I personally hate using quotes in code (other than exceptional situations or for text). What I meant was that if ; was only used as an end of command then where currently used in other contexts it could be changed to another symbol and possibly avoid the need for quotes.
Filter was one I used and it seems more natural for , to separate parameters.
I appreciate you cater for all complexities but this is how I see it.
Posted: 12 Feb 2008 23:00
by fishgod
When you search for a seperator for a filter-pattern a "," would be as bad as ";" because both of the characters can be part of a filename.
e.g. Using a filter like *,* to find every entry with a , in the name instead of filtering files with a special extension.
The best solution for this case would be to use a character which de facto can't be part of a filename!
There we have theese chars: \, /, :, *, ?, ", <, > and |
But *, ?, /, \ and " are allready reserved for special purposes, so we have to choice between :, <, > and |. I think a : is to ugly and < and > doesn't make a lot of sense so the best choice (for me) would be to use the | as delimiter between filenamepattern.
Than we can do: ::filer *.foo|*.bar or ::goto C:\|*.bat|*.sys
Little example with I can't solve with 6.90.0071:
Filelist:
1. foo.jpg
2. bar.jpeg
3. foobar.jpg;jpeg
4. foobar (jpg,jpeg)
Trying to get only the foobar.jpg;jpeg-item:
::filter *.jpg;jpeg //returns item 1 and shows me that "jpeg" is not a valid script command. Exactly what I expected
::filter "*.jpg;jpeg" //returns all the four items, not very nice
::filter """*.jpg;jpeg""" //return only item 1, don't know why
I don't see any solution for this here...
Ok, lets try to get the foobar (jpg,jpeg)-item:
::filter *.jpg,jpeg* //filter only for *.jpg all after the , is probably interpreted as second nonexisting parameter?
::filter "*jpg,jpeg*" //quoting works fine here (:
When you now use a , as seperator than we have the same problem as above here...
The existing of characters in filenames is a general problem, that should not be underrated!
Posted: 12 Feb 2008 23:23
by admin
fishgod wrote:Than we can do: ::filer *.foo|*.bar or ::goto C:\|*.bat|*.sys
I would agree to allow "|" as an alternative pattern separator. I don't see a problem with it, and, as you say, if the filename contains ";" there is no way to filter it using ";" as a separator.
BTW, Multiple Location Search in Find Files also allows these two separators, | and ;. A nice parallel...