This forum uses cookies. Click X button to hide this message. What is stored? / Privacy
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Pseudo variables requires capitalized first letter

 
Post new topic   Reply to topic    Total Commander Forum Index -> TC Behaviour which will not be changed Printable version
View previous topic :: View next topic  
Author Message
petermad
Power Member
Power Member


Joined: 05 Feb 2003
Posts: 7794
Location: Valsted, Denmark

PostPosted: Mon Jun 11, 2018 3:46 pm    Post subject: Pseudo variables requires capitalized first letter Reply with quote

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.

Quote:
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%
_________________
#524
Danish Total Commander Translator
TC 9.20rc1 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit. TC 2.91b3 on Android 6.0

Get Extended Total Commander Menus


Last edited by petermad on Wed Jun 20, 2018 3:31 pm; edited 3 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Hacker
Moderator
Moderator


Joined: 06 Feb 2003
Posts: 10891
Location: Bratislava, Slovakia

PostPosted: Mon Jun 11, 2018 4:21 pm    Post subject: Reply with quote

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

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.
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35752
Location: Switzerland

PostPosted: Tue Jun 12, 2018 8:20 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
petermad
Power Member
Power Member


Joined: 05 Feb 2003
Posts: 7794
Location: Valsted, Denmark

PostPosted: Tue Jun 12, 2018 9:51 am    Post subject: Reply with quote

Quote:
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:
Quote:
3. Pseudo environment variables from parameters of the function ShGetSpecialFolderLocation.
Syntax: %$name%

to:
Quote:
3. Pseudo environment variables from parameters of the function ShGetSpecialFolderLocation.
Syntax: %$NAME%


And:
Quote:
4. Pseudo environment variables from parameters of the function SHGetKnownFolderPath.
Syntax: %$name%

to:
Quote:
4. Pseudo environment variables from parameters of the function SHGetKnownFolderPath.
Syntax: %$Name%

_________________
#524
Danish Total Commander Translator
TC 9.20rc1 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit. TC 2.91b3 on Android 6.0

Get Extended Total Commander Menus
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35752
Location: Switzerland

PostPosted: Wed Jun 13, 2018 11:31 am    Post subject: Reply with quote

OK, I added a comment to the help in RC1.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
petermad
Power Member
Power Member


Joined: 05 Feb 2003
Posts: 7794
Location: Valsted, Denmark

PostPosted: Thu Jun 14, 2018 5:37 am    Post subject: Reply with quote

Quote:
OK, I added a comment to the help in RC1.


Great. Smile 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.
_________________
#524
Danish Total Commander Translator
TC 9.20rc1 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit. TC 2.91b3 on Android 6.0

Get Extended Total Commander Menus
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35752
Location: Switzerland

PostPosted: Fri Jun 15, 2018 4:04 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
petermad
Power Member
Power Member


Joined: 05 Feb 2003
Posts: 7794
Location: Valsted, Denmark

PostPosted: Fri Jun 15, 2018 12:22 pm    Post subject: Reply with quote

Quote:
I was sure you would complain about that!

Laughing
_________________
#524
Danish Total Commander Translator
TC 9.20rc1 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit. TC 2.91b3 on Android 6.0

Get Extended Total Commander Menus
Back to top
View user's profile Send private message Send e-mail Visit poster's website
petermad
Power Member
Power Member


Joined: 05 Feb 2003
Posts: 7794
Location: Valsted, Denmark

PostPosted: Wed Jun 20, 2018 3:36 pm    Post subject: Reply with quote

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.
_________________
#524
Danish Total Commander Translator
TC 9.20rc1 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit. TC 2.91b3 on Android 6.0

Get Extended Total Commander Menus
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35752
Location: Switzerland

PostPosted: Thu Jun 21, 2018 3:15 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC Behaviour which will not be changed All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Imprint/Impressum: This site is maintained by Ghisler Software GmbH
Privacy Policy | Datenschutzerklärung | Politique de Confidentialité

Using phpBB © phpBB Group