Wrong values passed for %C, %C1, %C2, %c, %c1, %c2

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Wrong values passed for %C, %C1, %C2, %c, %c1, %c2

Post by *MVV »

Unexpected results (marked red):
Flasher (Russian board) wrote:TC 9.12 32 bit. %C,%C1/%c,%c1 should return physical paths like %P%N/%p%n, but...
1. No selection. File is focused.
  • a) Left panel - physical dir, right (active) - virtual dir.
    %c or %c2: "D:\Right\Path\to\File Name.ext"
    %C or %C2: "\\\Virtual Panel\Virtual\Folders\Names\D:\Right\Path\to\File Name.ext"
    %C1 or %c1: "C:\Left\Path\D:\Right\Path\File Name.ext"

    b) Left panel (active) - virtual dir, right - physical dir.
    %c or %c1: "C:\Left\Path\to\File Name.ext"
    %C or %C1: "\\\Virtual Panel\Virtual\Folders\Names\D:\Left\Path\to\File Name.ext"
    %C2 or %c2: "D:\Right\Path\C:\Left\Path\to\File Name.ext"

    c) Left - virtual dir, right (active) - physical dir.
    %C or %c or %C2 or %c2: D:\Right\Path\RightFileName.ext
    %C1 or %c1: "\\\Virtual Panel\Virtual\Folders\Names\RightFileName.ext"

    d) Left - physical dir, right (active) - physical dir.
    %C or %c or %C2 or %c2: D:\Right\Path\RightFileName.ext
    %C1 or %c1: "C:\Left\Path\RightFileName.ext"
2. One file selected (not focused).
  • a) Left - physical dir, right (active) - virtual dir.
    %c or %c2: SelectedFileName.ext (Another file is focused.)
    %c or %c2: "\\\Virtual Panel\Virtual\Folders\Names\SelectedFileName.ext" (Item [..] is focused.)
    %c1: C:\Left\Path\FileNameUnderTheCursor.ext (Another file is focused.)
    %c1: C:\Left\Path\ (Item [..] is focused.)

    b) Left (active) - virtual dir, right - physical dir.
    %C or %C1: "\\\Virtual Panel\Virtual\Folders\Names\SelectedFileName.ext"
    %c or %c1: SelectedFileName.ext (Another file is focused.)
    %c or %c1: "\\\Virtual Panel\Virtual\Folders\Names\SelectedFileName.ext" (Item [..] is focused.)
    %C2: D:\Right\Path\SelectedFileName.ext
    %c2: D:\Right\Path\FileNameUnderTheCursor.ext (Another file is focused.)
    %c2: D:\Right\Path\ (Item [..] is focused.)

    c) Same as 1.c but %c1: "\\\Virtual Panel\Virtual\Folders\Names\FileNameUnderTheCursor.ext"

    d) Same as 1.d but %c1: "C:\Left\Path\FileNameUnderTheCursor.ext"
Test environment:
- Virtual Panel plugin.
- Subfolders C: and D: in \\\Virtual Panel\Virtual\Folders\Names\ folder contain directories Left from C:\Left and D:\Right.
- Some mentioned files are added to folder \\\Virtual Panel\Virtual\Folders\Names\.
- Sample buttonbar button for test:

Code: Select all

cmd.exe
/c "echo c: %c & echo c1: %c1 & echo c2: %c2 & echo C: %C & echo C1: %C1 & echo C2: %C2 & pause"
So, sometimes virtual paths are not resolved to physical ones, sometimes TC mixes path parts incorrectly.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

%C parameters don't currently support virtual paths/plugins. I will consider adding it.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Thank you!
raytc
Senior Member
Senior Member
Posts: 274
Joined: 2004-06-28, 11:03 UTC

Post by *raytc »

This does also work if I select two different files in the same panel (p.e. 2 files in the right panel):
"%C1" "%C2"
:D

What would be the "C" parameters to compare 2 directories?
Can I adapt it in order to use also 2 directories in the same panel?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

"%C1" "%C2" should return the same names as you get when using "Compare by content".

To pass the left and right directories to a program, use
"%P" and "%T" .
Author of Total Commander
https://www.ghisler.com
raytc
Senior Member
Senior Member
Posts: 274
Joined: 2004-06-28, 11:03 UTC

Post by *raytc »

Thank you. :)
Yes indeed if I select 2 directories it compares 2 directories.
If I select 2 files it compares 2 files.

Maybe better to use "%C1" "%C2" for both (comparing directories and files)

I don't understand the difference between "%C1" "%C2" and ""%P" "%T"
except that the last one passes left and right directory and the first one
whatever 2 directories.
Is that correct?
raytc
Senior Member
Senior Member
Posts: 274
Joined: 2004-06-28, 11:03 UTC

Post by *raytc »

Does anyone know the difference between "%C1" "%C2" and ""%P" "%T"?
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Help: button settings and parameters.

Post by *Stefan2 »

raytc wrote:Does anyone know the difference between "%C1" "%C2" and ""%P" "%T"?
For first idea read the help:

- open a button for editing
- press F1 key on your keyboard
- read
- cancel the button


- - - EDIT for clarification:
Any button will do, just one of the existing ones.

This will open the 'context sensitive' help page for the button settings and parameters.
That way you don't have to search the help yourself, TC will do that for you.




 HTH? :D
Last edited by Stefan2 on 2018-03-28, 12:20 UTC, edited 1 time in total.
raytc
Senior Member
Senior Member
Posts: 274
Joined: 2004-06-28, 11:03 UTC

Post by *raytc »

Searched in Help file: Found nothing
TC 9.51 (x64) - win10
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

raytc wrote:Searched in Help file: Found nothing
And why don't you follow the advice from Stefan2 ?
The help is exactly at the place whre parametsrs are configured.
So whats the problem to use it ?
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
raytc
Senior Member
Senior Member
Posts: 274
Joined: 2004-06-28, 11:03 UTC

Post by *raytc »

Are you supporting Stefan2?

I don't have a button associated with it. Where to open a button?
I just asked a question.

Tried to find it in the help but couldn't find anything.
no problem
Have a good day
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

raytc wrote:Are you supporting Stefan2?

I don't have a button. I just asked a question.

Tried to find it in the help but couldn't find anything.
no problem
Have a good day
I don't support Stefan2 but I fight against users like you,
which ask for help but are not willing to try anything.
If you don't have any button why are you posting on this thread ?
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2raytc
it isn't a rocket science - F1, Search for Button, press list topics and choose Button Bar. Read the topic carefully.
http://rgho.st/7RPv2ZqSh
Last edited by Ovg on 2018-03-28, 11:49 UTC, edited 1 time in total.
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
raytc
Senior Member
Senior Member
Posts: 274
Joined: 2004-06-28, 11:03 UTC

Post by *raytc »

Stefan2 can do it himself.
I've added it to the start menu.
But you're not here to help me, you're just want to make you own point.
TC 9.51 (x64) - win10
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Post by *tuska »

... OR ...
Press F1 for Help
Click on the "Search" tab
Search for: Dialog box: Configuration - Change button bar <ENTER>
Double-click on: Dialog box: Configuration - Change button bar
Click in the text
Press Ctrl + F
Type in what you are looking for, e.g. %C1, %P,...
Post Reply