Page 1 of 1

Button Parameter %"N"

Posted: 2011-09-05, 01:34 UTC
by chrizoo
.
This RFE/suggestion deals with the current inconsistent quoting of variables in the toolbar icons. My idea/syntax to solve the problem is as follow:

suggestion: %"N"

Instead of unnecessarily introducing a whole set of new parameters with non-intuitive/unrelated letters which the TC user has to learn, it would be sufficient and much more elegant to just use the EXISTING variables combined with a modifier character ("). It's function is to change the variable to a quoted one, as follows:

i.e.
%N .......... TC doesn't add quotes (under no circumstances)
%"N ......... TC only adds quotes if necessary
%"N" ........ force TC to add quotes (under all circumstances)


same with e.g. %P:

%P .......... no quotes
%"P ......... qutoes if necessary
%"P" ........ forced quotes
Now here comes the second part:
Variable combinations (formerly %P%N) should be merged as follows:
%PN .......... no quotes
%"PN ......... quotes if necessary
%"PN" ........ forced quotes
This has 2 advantages:

(1) syntax is easier readable and understandable

(2) the alternate syntax %"P"%"N" is problematic for many reasons:
(A) the user would expect that path and filename are quoted separately, i.e. "c:\path\""filename.ext"
(B) ambiguous situations can arise where quoted variables are combined with unquoted (i.e. %P%"N"), how should TC handle this?

For this reasons, the syntax %"PN" is more intuitive and also avoids abovementioned problems.

Posted: 2011-09-05, 06:40 UTC
by MVV
I don't think it is easy to understand. Especially odd number of quotes.

Posted: 2011-09-05, 06:50 UTC
by Balderstrom
Whether or not a new syntax is required, a fix would be nice. Although I've close to given up on believing any feature requests will actually be implemented. I'd love to be proven wrong, but I've been requesting usability fixes/improvements for 5 years and never seen a single one.

Posted: 2011-09-08, 12:22 UTC
by chrizoo
MVV wrote:I don't think it is easy to understand. Especially odd number of quotes.
what don't you understand?

Posted: 2011-09-08, 12:29 UTC
by MVV
IMHO it looks ugly. Quotes in parameters in Windows are used only to merge parameter parts.

Posted: 2011-09-08, 12:34 UTC
by chrizoo
Balderstrom wrote:Whether or not a new syntax is required, a fix would be nice. Although I've close to given up on believing any feature requests will actually be implemented. I'd love to be proven wrong, but I've been requesting usability fixes/improvements for 5 years and never seen a single one.
that's weird. I have been reading your improvement ideas for 5 years and I they were really consistently good. You often point out crucial things (like this one), which shouldn't be overlooked.

Posted: 2011-09-08, 12:36 UTC
by chrizoo
.
@MVV: ok, but that was not my question.

Posted: 2011-09-08, 13:44 UTC
by MVV
I didn't mean that your post is hard to read.
I did mean that syntax suggested by you is hard to read since it is non-standard and ugly. Especially its part that uses odd number of qouble-quotes.

By convention (that exists for years) command line %"PN dog cat must be treated as single parameter because quote is opened and is not closed (just made batch with string @echo 1[%1] 2[%2] 3[%3] and call it with parameters %"PN dog cat via cmd.exe).

And, parameter %"PN" is identical to %PN because double quotes should be removed from parameters (i.e. command cd "d:"\"docs" is valid - just try it via cmd.exe). So, such syntax is quite hard to read.

Posted: 2011-09-09, 00:16 UTC
by chrizoo
MVV wrote: ... I just made batch with string ....
... just try it via ...
hey you can't yet "try" or "test" it, because it IS NOT IMPLEMENTED YET, it's a feature suggestion, remember? I have no clue where you try to get at with your post, but it doesn't really matter:

If you don't like the syntax, suggest a better one!
I think it is still better than the other suggestion with adding new variables. I think that makes the syntax even more difficult (quote mode on ... quote mode off)

So far the situation is like this:

(1) There is a problem.
(2) Balderstrom suggests solution.
(3) chrizoo suggests solution.
(4) MVV just criticizes.

Posted: 2011-09-09, 06:10 UTC
by MVV
chrizoo wrote:hey you can't yet "try" or "test" it, because it IS NOT IMPLEMENTED YET, it's a feature suggestion, remember?
I was talking about DOS and Windows command line quoting rules. They exist for years. And you suggest to refuse them!

There was already a suggestion to add Q modifier for every parameter. So, %P is an unquted path while %QP is quoted path. Such syntax is quite easy to read and understand, and it doesn't contain any quotes that serve for absolutely different things. If you know Multiarc plugin, it uses same syntax (even more, it allows two modifiers, q for quoting all names and Q for quoting only names with spaces).

BTW I don't see any reason to add optional quoting because any program will understand name like "1.txt" even if it doesn't require quotes.
chrizoo wrote:So far the situation is like this:
I'm telling my opinion regarding your suggestion. I have such right, agree?

Posted: 2011-09-09, 07:04 UTC
by chrizoo
MVV wrote:I was talking about DOS and Windows command line quoting rules. They exist for years. And you suggest to refuse them!
I suggest you reread the thread because what you just said makes it clear that you didn't understand the RFE at all.
%P ... %QP ... q ... Q
As I said, I find my syntax more straightforward. It's a matter of taste.
I don't see any reason to add optional quoting because any program will understand name like "1.txt" even if it doesn't require quotes.
I already asked the exact same question in the thread you supposedly read: http://ghisler.ch/board/viewtopic.php?t=26969#226014
chrizoo wrote: I'm telling my opinion regarding your suggestion. I have such right, agree?
legally, yes. LOL ;)
no seriously, I really don't want to get into an argument with you. You have given me some good advice in the past which was very helpful to me and besides I want to get along with everyone here. I just felt that while Balderstrom and myself were trying to look for solutions you repeated the SAME criticism again and again in two or three threads without making any suggestion of your own. Of course you can say whatever you want and nobody will prevent you from doing so, but then again, there is such thing as constructive posts and destructive ones. Decide for yourself.

I think we should focus on the facts, this is getting a little off-topic.