Pseudo variables requires capitalized first letter

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

Moderators: white, sheep, Hacker, Stefan2

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

Pseudo variables requires capitalized first letter

Post by *petermad » 2018-06-11, 21:46 UTC

For some reason these works in buttons and in commandline:
cd %$LOCAL_APPDATA%
cd %$Local_appdata%
cd %$Local_Appdata%
cd %$LOcal_appdata%

But all lowercase like this:
cd %$local_appdata%
does not work, but generates a Read error when used in a button, and just do nothing from command line.

It is the same with for example cd %$downloads% wich doesn't work wheras cd %$Downloads% works.
04.08.17 Added: Windows Vista and newer: Support new pseudo environment variables described here: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457.aspx. Leave out prefix FOLDERID_, e.g. FOLDERID_Downloads -> %$Downloads% . Only fields with "Default Path" option are supported (32/64)
It is not new, it also happens in TC 8.52a

Is it a bug or a feature that the first letter after $ has to be capitalized?

It works fine with normal environment variables like:
cd %localappdata%
Last edited by petermad on 2018-06-20, 21:31 UTC, edited 3 times in total.
License #524
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.92b1 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
Hacker
Moderator
Moderator
Posts: 11043
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker » 2018-06-11, 22:21 UTC

petermad,
IIRC it's by design to avoid some conflict. Don't remember what kind of conflict, though.
Glad to have been of help! :D

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.

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

Post by *ghisler(Author) » 2018-06-12, 14:20 UTC

This is intentional because you can actually name a real environment variable $LOCAL_APPDATA!

e.g. via command line:
set $LOCAL_APPDATA=test
set $LOCAL_APPDATA

returns:
$LOCAL_APPDATA=test

Since environment variables are case insensitive, I have decided to get the real environment variable with %$local_appdata%, and the special value with %$LOCAL_APPDATA%. Only the first character is checked for upper/lowercase.
Author of Total Commander
http://www.ghisler.com

User avatar
petermad
Power Member
Power Member
Posts: 8066
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Post by *petermad » 2018-06-12, 15:51 UTC

I have decided to get the real environment variable with %$local_appdata%, and the special value with %$LOCAL_APPDATA%.
Maybe you should add that info to the Help page about Environment variables.

Ans maybe change the text:
3. Pseudo environment variables from parameters of the function ShGetSpecialFolderLocation.
Syntax: %$name%
to:
3. Pseudo environment variables from parameters of the function ShGetSpecialFolderLocation.
Syntax: %$NAME%
And:
4. Pseudo environment variables from parameters of the function SHGetKnownFolderPath.
Syntax: %$name%
to:
4. Pseudo environment variables from parameters of the function SHGetKnownFolderPath.
Syntax: %$Name%
License #524
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.92b1 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

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

Post by *ghisler(Author) » 2018-06-13, 17:31 UTC

OK, I added a comment to the help in RC1.
Author of Total Commander
http://www.ghisler.com

User avatar
petermad
Power Member
Power Member
Posts: 8066
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Post by *petermad » 2018-06-14, 11:37 UTC

OK, I added a comment to the help in RC1.
Great. :) But maybe you should also add:

"(at least the first character must be uppercase)"

to the section as well:

"4. Pseudo environment variables from parameters of the function SHGetKnownFolderPath."

since it also applies to that.
License #524
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.92b1 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

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

Post by *ghisler(Author) » 2018-06-15, 10:04 UTC

I was sure you would complain about that! But I prefer not to repeat it there because it's redundant.
Author of Total Commander
http://www.ghisler.com

User avatar
petermad
Power Member
Power Member
Posts: 8066
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Post by *petermad » 2018-06-15, 18:22 UTC

I was sure you would complain about that!
:lol:
License #524
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.92b1 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
petermad
Power Member
Power Member
Posts: 8066
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Post by *petermad » 2018-06-20, 21:36 UTC

For some reason on the env_vars.htm Help page there is an empty line between:

Music,
and
NetHood,

because of a bevildered <span class="s55"> </span> tag.
License #524
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.92b1 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

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

Post by *ghisler(Author) » 2018-06-21, 09:15 UTC

Hmm, there was a TAB character in that location, no idea how it went there. I will remove it.
Author of Total Commander
http://www.ghisler.com

Post Reply