[Resolved] Why Param= doesn't work always with Tc 11 commands ?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Galizza
Member
Member
Posts: 167
Joined: 2018-09-07, 05:21 UTC

[Resolved] Why Param= doesn't work always with Tc 11 commands ?

Post by *Galizza »

 
Hi, why Tc commands don't always allow paramaters using Param=   ?


These two ones works Ok
 

Code: Select all

Cmd=SELECTFILESBS
Param=%Z%Y%R

Code: Select all

Cmd=OPENTABS
Param=?%P%O.tab
 
But this one don't work, it even opens cm_CreateShortcut instead of cm_copy

Code: Select all

Cmd=cm_copy
Param=/V1
So i must use this one to copy + verify

Code: Select all

Cmd=cm_copy /V1
 
Thanks.
 
Last edited by Galizza on 2023-05-25, 13:52 UTC, edited 1 time in total.
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3278
Joined: 2003-05-06, 11:46 UTC

Re: Why Param= doesn't work always with Tc 11 commands ?

Post by *Sir_SiLvA »

Galizza wrote: 2023-05-21, 14:00 UTC  
Hi, why Tc commands don't always allow paramaters using Param=   ?
Because not every command supports parameters.

use the tc wiki to check which command supports paramters:
https://www.ghisler.ch/wiki/index.php?title=List_of_internal_commands
Hoecker sie sind raus!
User avatar
petermad
Power Member
Power Member
Posts: 14741
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Why Param= doesn't work always with Tc 11 commands ?

Post by *petermad »

2Galizza
Currently none of the cm_commands) (or em_commands) supports parameters in the Param field - notice that if you use cm_commands via the GUI - either the Change button dialog or the Choose Command dialog (cm_CommandBrowser) the Parameters field is disabled.
Last edited by petermad on 2023-05-22, 06:46 UTC, edited 2 times in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
petermad
Power Member
Power Member
Posts: 14741
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Why Param= doesn't work always with Tc 11 commands ?

Post by *petermad »

2Sir_SiLvA
Because not every command supports parameters.
Correct, but the cm_copy in Galizza's example does support parameters (in TC 11.00)
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Galizza
Member
Member
Posts: 167
Joined: 2018-09-07, 05:21 UTC

Re: Why Param= doesn't work always with Tc 11 commands ?

Post by *Galizza »

2Sir_SiLvA & petermad

Understood, thanks.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Why Param= doesn't work always with Tc 11 commands ?

Post by *ghisler(Author) »

The cm_commands can be chained (separated by comma), so the command field can hold multiple of them. It would be unclear for which of the commands the parameter field is meant.
Author of Total Commander
https://www.ghisler.com
User avatar
beb
Senior Member
Senior Member
Posts: 430
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Why Param= doesn't work always with Tc 11 commands ?

Post by *beb »

ghisler(Author) wrote: 2023-05-22, 12:56 UTC ...It would be unclear for which of the commands the parameter field is meant.
If this is the only obstacle, can't believe there might not be found a developer- and user-friendly solution.
E.g., based on positional and/or explicit referring approach (of course, it implies additional params string parsing in the event of the cm_commands chain case occurs):
cmd=cm_1,cm_2,cm_3
param=%X[1]
where param %X is applicable to the cm_1 command only
param=%X[3]
where param %X is applicable to the cm_3 command only
param=%X[1],%Y[2],%Z[3]
where params %X,%Y,%Z are applicable to the commands cm_1, cm_2, cm_3 respectively.
param=%X
where param %X is applicable to the whole command chain.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Why Param= doesn't work always with Tc 11 commands ?

Post by *ghisler(Author) »

Why not just put the parameters in the command field? Then it would be clear which one is for which command.
Author of Total Commander
https://www.ghisler.com
User avatar
beb
Senior Member
Senior Member
Posts: 430
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Why Param= doesn't work always with Tc 11 commands ?

Post by *beb »

ghisler(Author) wrote: 2023-05-23, 22:34 UTC Why not just put the parameters in the command field?
I was too afraid to tell the same idea.
I'm just an average user and often tend to adhere to the Otto von Bismarck politics principles of the art of the possible.
You are the developer, it's much easier for you to take such liberties.
Cheers.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Why Param= doesn't work always with Tc 11 commands ?

Post by *Fla$her »

petermad wrote: 2023-05-21, 14:29 UTC Currently none of the cm_commands) (or em_commands) supports parameters in the Param field
For em_commands, this field is available for hotkeys on the Misc. page.

ghisler(Author) wrote: 2023-05-22, 12:56 UTC The cm_commands can be chained (separated by comma), so the command field can hold multiple of them. It would be unclear for which of the commands the parameter field is meant.
I discussed the problem with you when specifying only one command and offered a reliable way out:
Fla$her wrote: 2023-05-18, 09:33 UTC 1. You can lock the "Parameters:" field only if there is em_ in front and a comma outside the quotation marks.
The same may apply to cm_commands, where names and paths are allowed in the parameters.

ghisler(Author) wrote: 2023-05-23, 22:34 UTC Why not just put the parameters in the command field? Then it would be clear which one is for which command.
You know the answer perfectly well yourself — because it opens access to the necessary parameters when working with names, paths and lists (%N, %V, %O, %E, %P, %T, %S, %[UW]L, etc.)
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14741
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Why Param= doesn't work always with Tc 11 commands ?

Post by *petermad »

For em_commands, this field is available for hotkeys on the Misc. page.
Not just for em_commands, also for cm_commands in the Keyboard remapping setup.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Why Param= doesn't work always with Tc 11 commands ?

Post by *Fla$her »

2petermad
Sure, including those without cm_. This is part of my request, so I didn't focus on it.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Why Param= doesn't work always with Tc 11 commands ?

Post by *ghisler(Author) »

OK, for now I have added support for the parameter field as long as there is no comma in the command field. Both the command and parameter fields may contain parameters, e.g.
Command: CM_LIST /T1V
Parameters: %T%M
would view the file under the cursor in the target panel as plain text with variable font.

When the user enters a comma in the commands field in addition to an internal command, the parameters field will be disabled.
Please let me know what you think when beta 4 comes out.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Why Param= doesn't work always with Tc 11 commands ?

Post by *Fla$her »

2ghisler(Author)
Thank you! Great news! 😀
A comma in the parameters with quotes, as suggested above, will be ignored?
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Why Param= doesn't work always with Tc 11 commands ?

Post by *ghisler(Author) »

A comma in the parameters with quotes, as suggested above, will be ignored?
No, currently I'm simply checking for the presence of a comma anywhere.
Author of Total Commander
https://www.ghisler.com
Post Reply