[implemented] cm_OpenDriveByIndex with negative parameters

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

[implemented] cm_OpenDriveByIndex with negative parameters

Post by *petermad »

I would like to suggest negative parameters for the new TC 11.00 cm_OpenDriveByIndex command to count the drives from the end - so that cm_OpenDriveByIndex -1 would open the last drive.

Equivalent to negative parameters for cm_*ActivateTab*
Last edited by petermad on 2023-06-21, 16:16 UTC, edited 6 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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: cm_OpenDriveByIndex with negative parameters

Post by *Fla$her »

Support++
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_OpenDriveByIndex with negative parameters

Post by *petermad »

Another approach could be if cm_OpenDriveByIndex went to the last drive if the index is higher than the last drive: for example cm_OpenDriveByIndex 99
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: cm_OpenDriveByIndex with negative parameters

Post by *Fla$her »

2petermad
Why complicate it? This is a bad option. We not only need the last one, but also the penultimate one with -2, etc.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_OpenDriveByIndex with negative parameters

Post by *petermad »

We not only need the last one, but also the penultimate one with -2, etc.
I agree, but if we can't have what I first suggested maybe we can have the other.
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: cm_OpenDriveByIndex with negative parameters

Post by *Fla$her »

2petermad
My gut tells me that the first cannot be more difficult to implement than the second. ;)
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: cm_OpenDriveByIndex with negative parameters

Post by *ghisler(Author) »

Using negative numbers is more logical (and would be the same as for cm_*ActivateTab*), so I will use that. Please note, however, that this will have different results whether the drive buttonbar is enabled or not (there are more items in the drive dropdown list).
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: cm_OpenDriveByIndex with negative parameters

Post by *Fla$her »

2ghisler(Author)
And can you, in accordance with the command name, exclude cm_OpenNetwork from the list, leaving only drives?
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_OpenDriveByIndex with negative parameters

Post by *petermad »

Hope that USB-drives and the uX drives (cellphones) can be included even though they are volatile in the drive button bar / combobox
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: cm_OpenDriveByIndex with negative parameters

Post by *ghisler(Author) »

Why not both? I will implement it like this:
Numbers below -100 count from the last button, so -101 would be the last button, -102 the second-last etc.
Numbers below 0 but above -100 count from the last drive letter
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: cm_OpenDriveByIndex with negative parameters

Post by *Fla$her »

Trade-off decision. 👌
07.06.23 Added: cm_OpenDriveByIndex can now accept negative numbers below -100, where -101 would be the last button instead of the last drive (-1) (32/64)
But I also meant positive values. I.e. I don't want to call cm_OpenNetwork when the conditional Ctrl/Shift + 6/7/etc is accidentally pressed. How to deal with this?
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_OpenDriveByIndex with negative parameters

Post by *petermad »

history,txt wrote:07.06.23 Added: cm_OpenDriveByIndex can now accept negative numbers below -100, where -101 would be the last button instead of the last drive (-1) (32/64)
Confirmed implemented in TC 11.00b6 - but with several problems - see: https://ghisler.ch/board/viewtopic.php?t=79271
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_OpenDriveByIndex with negative parameters

Post by *petermad »

history,txt wrote:07.06.23 Added: cm_OpenDriveByIndex can now accept negative numbers below -100, where -101 would be the last button instead of the last drive (-1) (32/64)
Confirmed implemented in TC 11.00b6 - but with several problems - see: https://ghisler.ch/board/viewtopic.php?p=433863#p433863
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_OpenDriveByIndex with negative parameters

Post by *petermad »

history.txt wrote:16.06.23 Added: cm_OpenDriveByIndex with positive values now only changes to drives, add 100 to also change to other folder types (32/64)
13.06.23 Fixed: cm_OpenDriveByIndex didn't work with some values when the hotkey contained Ctrl/Shift (32/64)
07.06.23 Fixed: cm_OpenDriveByIndex didn't work as described with negative numbers when drive buttonbars were enabled (32/64)
All of the above implemented or fixed in TC 11.00b8 :-)
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply