WAD Failure of Alias Command with /Z Option

Jun 2, 2008
386
2
Newton, MA
I have always used an alias with "unalias * & alias /r alias.cfg diralias.cfg" to clear and reload my definitions of regular and directory aliases. Today I noticed the /Z option and tried using "alias /r /z alias.cfg diralias.cfg" instead. I end up with no regular aliases defined! The command apparently does not work with multiple files. When I run "alias /r /z alias.cfg & alias /r diralias.cfg", the aliases get loaded correctly. It seems that the /Z option is applied (erroneously) to each file in the list. It should be applied only once before any files are loaded.

I have tried this in versions 25 and 27.
 

rconn

Administrator
Staff member
May 14, 2008
12,404
152
WAD - /Z clears the entire alias list before the /R reads a file. (The help file implies this but doesn't make it as explicitly clear as might be desired.)

If /Z worked with multiple files, it would be worse than useless (and slower than a simple /R) - it would have to read both the entire existing alias list and the entire /R file to determine which entries to delete/replace with new entries. /Z is faster because it wipes the list and /R doesn't have to scan it for every entry.
 
Jun 2, 2008
386
2
Newton, MA
OK. I see your point. I know that the two files contain completely different types of aliases, but the command doesn't know that.

Does using the /Z option have any advantage over first deleting all aliases with "unalias *"? Of course, the time in my case is completely negligible in any case.

P. S. Why are all the editing options/icons (bold, italic, etc.) grayed out for me?
 

rconn

Administrator
Staff member
May 14, 2008
12,404
152
"alias /R /Z" is somewhat faster (because the /R doesn't have to check for an existing name) & easier to write than "unalias * & alias /R", but there's no functional difference. Unless you have a few thousand aliases you probably won't notice the time.

I don't know what editing options you're referring to.
 
  • Like
Reactions: Joe Caverly
Jun 2, 2008
386
2
Newton, MA
What happens if the file with alias definitions has multiple definitions for the same alias? Does "alias /r" check with each definition for a prior definition? Another way to put that: suppose I ran "copy alias.cfg+diralias.cfg al.cfg" to combine all my definitions into one file and then ran "alias /r /z al.cfg" to load them? If that would work, then why can't the /Z option be used with a list of files, all of which are simply read in without checking?

By editing options, I'm talking about the screen in this forum for composing messages (like this one). I cannot make text bold, for example, because the "B" icon above, along with all the others except for the three-dots ones, is greyed out. I seem to be in plian-text-only mode.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,493
91
Albuquerque, NM
prospero.unm.edu
By editing options, I'm talking about the screen in this forum for composing messages (like this one). I cannot make text bold, for example, because the "B" icon above, along with all the others except for the three-dots ones, is greyed out. I seem to be in plian-text-only mode.

How about the icon that looks like two brackets [ ] ? Does that one work?
 
Jun 2, 2008
386
2
Newton, MA
There was no such icon. However, I tried all three triple-dot icons for more options, and the one at the far right had it. When I clicked it, the other options became active. I can now make bold text. Thank you!!!
 
May 20, 2008
11,530
102
Syracuse, NY, USA
How about the icon that looks like two brackets [ ] ? Does that one work?
Good one Charles! That toggles all the icons to/from greyed out. The [ ] icon is on the far right, near "Preview".

1622601741610.png


Yes/no?
 
May 20, 2008
11,530
102
Syracuse, NY, USA
Aha! Jay must be using the "Flare (Child)" style which has a different editing toolbar. Jay, if you haven't tried it, try the "Default" style. The style picker is way at the bottom of the page.
 
Jun 2, 2008
359
4
I believe I have the Default style set and a zoom level of 150% in my browser pushes the Toggle BB code button into the More options menu.

Edit: Actually, I should say it gets pushed into a 3rd More options menu that gets created on the right, next to the Preview button (and the text for the Preview button is eliminated).
 
Jun 2, 2008
386
2
Newton, MA
Thank you to all of you. I'm now in the standard style, and everything looks much better!
 
Jun 2, 2008
386
2
Newton, MA
Returning to the original topic of the /Z option for alias...

I did some experiments with reading aliases from files. With just the /R option, the command reads in the lines. If an alias has already been defined, it is overwritten, so one does not end up with multiple definitions.

With the /Z option added, all existing definitions are removed, and the definitions in the file are added, even if there are multiple definitions for the same alias. When there are multiple definitions, the first definition in the file is the one that is run. Since the /R option adds the new definitions to the end of the list, it is critical to search for -- and remove -- any previous definition.

I've now gone back and done some further experiments after using /R /Z to get two definitions for the same alias.

Code:
TCC(27.01.23): C:\tcmd\ver27>alias /r /z diralias.cfg

TCC(27.01.23): C:\tcmd\ver27>alias | tail /n 3
lap_nergc:=lap_docs:genealogy\conferences\NERGC2011\
zzz=echo Def 1
zzz=echo Def 2

If I now define zzz again, only the first one is replaced. This makes sense, since that's the one that TCC will use, so why waste time looking for more.

Code:
TCC(27.01.23): C:\tcmd\ver27>alias zzz=echo Def 3

TCC(27.01.23): C:\tcmd\ver27>alias | tail /n 3
lap_nergc:=lap_docs:genealogy\conferences\NERGC2011\
zzz=echo Def 3
zzz=echo Def 2

To see how much time it takes to load all of my aliases from the pair of files including all the overhead of duplicate checking, I ran the following a few times.

Code:
TCC(27.01.23): C:\Users\Jay\Dropbox>timer alias /r %tcmddir\alias.cfg %tcmddir\diralias.cfg
Timer 1 on:  0:03:29
Timer 1 off:  0:03:29  Elapsed: 0:00:00.110

TCC(27.01.23): C:\Users\Jay\Dropbox>timer alias /r %tcmddir\alias.cfg %tcmddir\diralias.cfg
Timer 1 on:  0:03:39
Timer 1 off:  0:03:39  Elapsed: 0:00:00.109

TCC(27.01.23): C:\Users\Jay\Dropbox>timer alias /r %tcmddir\alias.cfg %tcmddir\diralias.cfg
Timer 1 on:  0:05:06
Timer 1 off:  0:05:06  Elapsed: 0:00:00.110

The files each have about 1000 lines, a few of which are comments. One would have to have a lot of aliases for this to be an issue.
 
Similar threads
Thread starter Title Forum Replies Date
M MOVE does not behaves like intended (on failure) Support 1
M WAD /elevated failure... Support 13
M TCmd Failure... Support 1
M Start "/Elevated" failure... Support 3
C TakeCommand 18 Installation Failure Support 13
Jay Sage Failure of ACTIVATE to Set a Window Position Support 3
M A UNC name failure... Support 28
S WAD Xenforo posts - EMAIL delivery failure Support 18
M %_EXECARRAY failure... Support 2
Stefano Piccardi UTF-8 BOM marker @iniread failure Support 6
S Failure: _EXECARRAY Support 1
S @DEVICE failure Support 7
Roedy reame.txt failure in installer Support 1
D iftp failure after upgrading to build 65 Support 9
N Command History Failure? Support 3
N Directory wildcard failure? Support 1
J dir failure with some unicode characters Support 6
J V12 PDIR failure Support 1
J OT: Windows 7 failure Support 24
U failure to load plugin Support 5
Jay Sage Failure in TCMD Help with Favorites Support 9
S SHORTCUT command failure Support 1
S Recent website and forum failure Support 9
J Find failure dialog box failure Support 0
Jay Sage Failure with WINDOW Command Support 4
dcantor IF ISAPP failure Support 12
D Can alias pass parameters to for command? Support 3
Jay Sage Issue with CD_ENTER Alias Support 37
Jay Sage Issue with CD_LEAVE Alias Support 3
R @select inside alias gives different (insanely small) window Support 7
kb6ojs ALIAS with multiple commands? Support 9
vefatica Can I alias @@Ctrl-Shift-Alt-u? Support 4
D Alias with setdos no longer works Support 21
vefatica TPIPE in an alias? Support 2
Peter Murschall TCC V26.01.3x Debugging has problems with Alias /R Support 1
Peter Murschall CMDebug 26.01.37 has problems with Alias Support 21
samintz How to? Alias or prompt? Support 1
MickeyF expand alias in cmdline with Ctrl-F in TCC Support 21
Jay Sage Directory Alias Access to FTP Servers Support 2
rps How to? Shralias and producing history.sav, alias.sav .. Support 6
J Alias @@F5 hotkey Support 2
vefatica alias.sav not accurate Support 8
Joe Caverly Using a Directory Alias with @iniwrite fails Support 14
N multiple command alias and redirection Support 0
vefatica SETLOCAL ... ALIAS ... pipes Support 2
B TCC 21.01.50 Problem with ALIAS /r and SET /r Support 2
rps How to? Alias/Command line use of *log on/off Support 2
MickeyF alias terminating before it should Support 3
JohnQSmith ALIAS /R in TCSTART.BTM Support 9
D Alias in batch file Support 3

Similar threads