Where am I going wrong with ALIAS???

May 24, 2010
855
0
Northlake, Il
Not having used the "Alias" command much, I decided to use it more because it could, as is its main purpose, save me some typing. However, I have been totally unsuccessful in getting any of my new aliases to work correctly. Here's a sample test alias I made:

Ac*tualFiles=D:\DOS\StartX ActualFiles

Here's the full content of D:\DOS\StartX.bat (it's a batch rather than .btm file purely for testing purposes):

@Echo %1 %2 %3 %4 %5 %6 %7 %8 %9

And here's the result:

D:\DOS\StartX EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs
EchoArgs
D:\DOS\StartX EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs
EchoArgs
D:\DOS\StartX EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs
EchoArgs

displayed over and over and over again in an infinite loop. All of my other aliases result in a variation on the same theme (only differing in the name of the batch file that is being invoked and possibly the parameter(s) that are being used), all of which batch files, for testing purposes, have the same content as the above. I must admit I am totally bamboozled at this point...
 
Jan 19, 2011
604
14
Norman, OK
Ac*tualFiles=D:\DOS\StartX ActualFiles
The problem is with the alias, not the batch file. The alias appears to be self-referential, calling itself after calling the StartX batch file. Changing it to the following should fix it.
Code:
Ac*tualFiles=D:\DOS\StartX
 
May 20, 2008
11,391
99
Syracuse, NY, USA
It would seem there's something you're not telling us. Where did EchoArgs come
from? Anyway, it works OK for me:

Code:
v:\> type startx.bat
@Echo %1 %2 %3 %4 %5 %6 %7 %8 %9

v:\> alias actualfiles
v:\StartX ActualFiles

v:\> actualfiles
ActualFiles

On Sat, 12 Mar 2011 23:32:43 -0500, mathewsdw <> wrote:

|Not having used the "Alias" command much, I decided to use it more because it could, as is its main purpose, save me some typing. However, I have been *totally* unsuccessful in getting *any* of my new aliases to work correctly. Here's a sample test alias I made:
|
|Ac*tualFiles=D:\DOS\StartX ActualFiles
|
|Here's the full content of D:\DOS\StartX.bat (it's a batch rather than .btm file purely for testing purposes):
|
|@Echo %1 %2 %3 %4 %5 %6 %7 %8 %9
|
|And here's the result:
|
|D:\DOS\StartX EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs
|EchoArgs
|D:\DOS\StartX EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs
|EchoArgs
|D:\DOS\StartX EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs EchoArgs
|EchoArgs
|
|displayed over and over and over again in an infinite loop. All of my other aliases result in a variation on the same theme (only differing in the name of the batch file that is being invoked and possibly the parameter(s) that are being used), all of which batch files, for testing purposes, have the same content as the above. I must admit I am totally bamboozled at this point...
 
May 24, 2010
855
0
Northlake, Il
It would seem there's something you're not telling us. Where did EchoArgs come from? Anyway, it works OK for me:

Code:
v:\> type startx.bat
@Echo %1 %2 %3 %4 %5 %6 %7 %8 %9

v:\> alias actualfiles
v:\StartX ActualFiles

v:\> actualfiles
ActualFiles
[/QUOTE]Vince, clearly you are a night-owl like me. But to answer your question, I don't have a [B]clue[/B] where that "EchoArgs" was coming from since it was [B]not[/B] in the StartX batch file that I was using, and I previously copied and pasted the contents of that file [B]exactly[/B] as it was to this thread, with no editing/formatting/exclusions/inclusions whatsoever.  However, I found and fixed the original problem.  In the original alias file, I had lines that were similar to this:
[CODE]Ali*s=D:\DOS\StartX [I]parameters[/I]
If I changed those aliases to something like this:
Code:
Ali*s=Start D:\DOS\StartX [I]parameters[/I]
I got it mostly working. I don't really understand why I needed a "Start" command to run a batch file, but I really don't care that much as long as things are working. However, there was one "Alias" line that caused "piping" to stop working altogether if that line was in the loaded "Alias" file. That line was:
Code:
Fin*dSong=Start D:\DOS\StartX FindSong
if that line was in the loaded "Alias" file, the result of
Code:
dir | Find "Alias"
was:
Code:
TCC: (Sys) The system cannot find the file specified.
 "D:\DOS\StartX"
which was really odd given that there was a "StartX.btm" file (the contents of which I showed previously) in the "D:\DOS" directory and I was not even referring to it (directly or indirectly) in the command sequence. (I was using that piping sequence purely for testing purposes; I found that piping was not working altogether when trying to use it in an actually-useful way.) If that line was NOT in the loaded alias file, the result of the previous command sequence was:
Code:
 3/13/2011   0:00           3,078  Alias-1.txt
 3/12/2011  23:54           3,079  Alias-2.txt
 3/12/2011  23:01           2,981  Alias-3.txt
 3/13/2011   0:35           3,466  Alias.txt
 3/13/2011   3:01           1,853  GoodAlias.txt
which was exactly what it should have been. The really odd thing was that that line, as far as I could tell, was exactly like a fair number of other lines in the loaded alias file (the "StartX" batch file is a batch-file consolidator where I place a fair number of processes in one single batch file rather than having dozens of rather small batch files), differing only in the name of the alias and, of course, the parameters that were being passed to the StartX batch file. The simple truth is that I can live without that particular alias; I mention it primarily not to leave you (and any one else who reads these posts) "hanging" and also because it is a real mystery to me that is worth pursuing mostly out of intellectual curiosity. - Dan
 
May 20, 2008
11,391
99
Syracuse, NY, USA
On Sun, 13 Mar 2011 05:00:28 -0400, mathewsdw <> wrote:

|Code:
|---------
|Fin*dSong=Start D:\DOS\StartX FindSong
|---------
|if the line is in the loaded "Alias" file, the result of
|Code:
|---------
|dir | Find "Alias"
|---------
| is:
|Code:
|---------
|TCC: (Sys) The system cannot find the file specified.
| "D:\DOS\StartX"
|---------

That one is OK here also, doing what I'd expect it to do.

Code:
v:\> type startx.bat
@Echo %1 %2 %3 %4 %5 %6 %7 %8 %9

v:\> alias | grepp FindS
Fin*dSong=v:\StartX FindSong

v:\> dir | find "Alias"
FindSong "Alias"
 
May 24, 2010
855
0
Northlake, Il
On Sun, 13 Mar 2011 05:00:28 -0400, mathewsdw <> wrote:

|Code:
|---------
|Fin*dSong=Start D:\DOS\StartX FindSong
|---------
|if the line is in the loaded "Alias" file, the result of
|Code:
|---------
|dir | Find "Alias"
|---------
| is:
|Code:
|---------
|TCC: (Sys) The system cannot find the file specified.
| "D:\DOS\StartX"
|---------

That one is OK here also, doing what I'd expect it to do.

Code:
v:\> type startx.bat
@Echo %1 %2 %3 %4 %5 %6 %7 %8 %9

v:\> alias | grepp FindS
Fin*dSong=v:\StartX FindSong

v:\> dir | find "Alias"
FindSong "Alias"
Vince, I just clarified my previous posting, you might want to re-read it. However, I stand by my issue that that does not work for me (I just now tried it again), but maybe it's a mute point by now...
 
May 24, 2010
855
0
Northlake, Il
Works for me:

C:\Junk>alias Ac*tualFiles=c:\junk\StartX ActualFiles

C:\Junk>ac
ActualFiles

C:\Junk>actualfiles
ActualFiles

C:\Junk>type StartX.bat
@Echo %1 %2 %3 %4 %5 %6 %7 %8 %9

C:\Junk>

TCC 12.01.44 Windows Vista [Version 6.0.6002]
Thanks! I tried a number of things and I'm not sure what fixed it (bad memory again; it's getting almost critical), but something fixed it. I wish I could be more specific, but it is no longer a problem (which is the important thing)....
 
Similar threads
Thread starter Title Forum Replies Date
Peter Murschall BDEBUGGER "Run to Cursor" - where is it ? Support 1
Alpengreis How to? Where is a ChangeLog for v25 build 16 Support 4
vefatica Where's @TASCII? Support 0
vefatica DO /L, where did my string go? Support 6
vefatica Where did "BP-White" go? Support 1
MickeyF where to view the latest JPSoft newsletter? Support 0
vefatica Where did my font go? Support 16
M WAD A case where the "List" command is clearly not working at all... Support 4
S Forum: Where is "what's new" control information? Support 1
Roedy where are the colours Support 1
G Where is JpSoft.com? Support 12
Gorlash tcc V11.00.37 - where is history.txt ?? Support 1
C how to copy to folder where I need admin rights Support 5
vefatica Where's the email? Support 0
M TCC Can't find WScript.exe where it says it is Support 0
C where's the .ini file gone? Support 3
vefatica What's going on? Support 6
M What's going on here????? Support 6
M Simply put, Help! (I can't figure out what's going on here.) Support 6
J 4NT problems after going to Windows 7 Support 5
JohnQSmith New online help file wrong logo Support 7
vefatica @EXECSTR ... TCSTART ... something's wrong! Support 7
R History window wrong size, can't remember size change Support 12
mfarah Fixed The DATE command produces the wrong error message. Support 1
MikeBaas @regsetenv complains "wrong parameter" Support 14
mikea How to? TCC registered to wrong 'entity' Support 5
T @replace -- what is wrong here Support 2
vefatica Fixed KEYSTACK /i with repeat count sends wrong keys Support 7
C ZIP/U compares wrong timestamp Support 13
vefatica @WORDS, often wrong Support 0
vefatica gcd() ... wrong answer, lcm() hangs Support 5
D What is wrong with this code? Support 7
vefatica WAD DIR /HL still gets names wrong Support 16
H Fixed DIR /G returns wrong sizes Support 2
M Another "What is wrong?" Support 8
M What is wrong with this command? Support 4
vefatica Updater says wrong version Support 1
CWBillow Wrong icons keep sticking Support 6
M How to? What am I doing wrong/not understanding? Support 10
C News link wrong Support 1
M What am I doing wrong? Support 12
M What am I doing wrong here? Support 2
C Forum column headings wrong? Support 4
gschizas Installation folder for TCMD x64 15.1 is wrong Support 5
Dan Glynhampton Documentation v15 help: ECHOXERR Help Page Title is Wrong Support 0
M What am I doing wrong in this (very simple!) code? Support 3
vefatica Something wrong with @PID Support 10
J zip wrong central directory signature Support 12
S Fixed _DO_FILES and _DO_DIRS wrong Support 0
B Downloading Updates - Error: Wrong file size?? Support 3

Similar threads