TCC/LE incompatibility with CMD.exe

Nov 15, 2010
8
0
Hi, I found a minor incompatibility with TCC vs CMD.exe.

If you have an IF statement such as:

if defined var JAVA_HOME(

This gives an error in TCC but not in CMD. The solution is to add a space prior to the open paren. This works in both CMD and TCC. Basically, it sounds like a parser error.

I'm using TCC/LE v 11.00.40 by the way on Windows 7.

Just thought you'd want to know.
 

rconn

Administrator
Staff member
May 14, 2008
12,344
149
> Hi, I found a minor incompatibility with TCC vs CMD.exe.
>
> If you have an IF statement such as:
>
> *if defined var JAVA_HOME(*
>
> This gives an error in TCC but not in CMD. The solution is to add a space
prior

> to the open paren. This works in both CMD and TCC. Basically, it sounds
like a

> parser error.

Not reproducible here.

Can you provide the full IF statement (not just the fragment you quoted)?

Rex Conn
JP Software
 
Nov 15, 2010
8
0
Hey it's only taken me 9 years to answer but better late than never!

Running the following version:
CMD.exe on Microsoft Windows [Version 10.0.14393]
TCC LE 14.00.9 x64 Windows 10 [Version 6.3.14393]

I put these four statements in a batch file called if_test.bat.

IF DEFINED PATH(ECHO 1) ELSE ECHO NOT 1
@ECHO EXIT CODE %ERRORLEVEL% %_?
IF DEFINED PATH (ECHO 2) ELSE ECHO NOT 2
@ECHO EXIT CODE %ERRORLEVEL% %_?
IF NOT DEFINED XXX(ECHO 3) ELSE ECHO NOT 3
@ECHO EXIT CODE %ERRORLEVEL% %_?
IF NOT DEFINED XXX (ECHO 4) ELSE ECHO NOT 4
@ECHO EXIT CODE %ERRORLEVEL% %_?
IF DEFINED PATH(ECHO 5)
@ECHO EXIT CODE %ERRORLEVEL% %_?



On CMD, I get this:
C:\src\tcc>if_test

C:\src\tcc>IF DEFINED PATH(ECHO 1) ELSE ECHO NOT 1
EXIT CODE 0 _?

C:\src\tcc>IF DEFINED PATH (ECHO 2 ) ELSE ECHO NOT 2
2
EXIT CODE 0 _?

C:\src\tcc>IF NOT DEFINED XXX(ECHO 3) ELSE ECHO NOT 3
'3)' is not recognized as an internal or external command,
operable program or batch file.
EXIT CODE 0 _?

C:\src\tcc>IF NOT DEFINED XXX (ECHO 4 ) ELSE ECHO NOT 4
4
EXIT CODE 0 _?

C:\src\tcc>IF DEFINED PATH(ECHO 5)
EXIT CODE 0 _?


On TCC, I get this:
[C:\src\tcc]if_test.bat
IF DEFINED PATH(ECHO 1) ELSE ECHO NOT 1
EXIT CODE 0 2
IF DEFINED PATH (ECHO 2) ELSE ECHO NOT 2
2
EXIT CODE 0 0
IF NOT DEFINED XXX(ECHO 3) ELSE ECHO NOT 3
TCC: C:\src\tcc\if_test.bat [5] Unknown command "ELSE"
EXIT CODE 2 2
IF NOT DEFINED XXX (ECHO 4) ELSE ECHO NOT 4
4
EXIT CODE 2 0
IF DEFINED PATH(ECHO 5)
C:\src\tcc\if_test.bat [9] Usage : IF [/I] [NOT] condition [.AND. | .OR. | .XOR. [NOT] condition ...] command
EXIT CODE 2 1

Test Case 5 is where the difference is apparent. Basically CMD is silent where TCC issues an error. I think it's actually a bug in CMD. Adding the ELSE seemed to change the behavior which is why I wrote cases 1 and 5.

But like I said in my original post, it's pretty minor.

Ron
 

rconn

Administrator
Staff member
May 14, 2008
12,344
149
Not sure exactly what you want here ...

#5 is definitely a syntax error. (You cannot embed the leading '(' of a command group inside another argument.)

Do you want TCC to fail to process the line and also fail to report an error (like CMD is doing)? And if so, what benefit would that provide?
 
Similar threads
Thread starter Title Forum Replies Date
Jesse Heines Request for TCC Date Command Custom Format Example TCC/LE Support 4
P TCC LE crashes without any info after recent windows updates TCC/LE Support 3
V TCC LE doesn't expand %~ff correctly TCC/LE Support 5
A vcvarsall.bat command not working on TCC LE command prompt TCC/LE Support 16
M DEBUG dialogs from TCC TCC/LE Support 1
Captain'Flam False condition in IF force loop exit (TCC/LE 14 64bits) TCC/LE Support 3
M How to get the number of chars, which fit in the currently displayed TCC-window? TCC/LE Support 3
M TCC/LE works with Windows Insider Skip Ahead Build 17618 TCC/LE Support 1
D Bug with TCC/LE and volumes mounted under directories TCC/LE Support 5
B Error in TCC/LE when succeed smoothly in native windows cmd.exe TCC/LE Support 6
A TCC/LE x64 no longer works with Windows 10 Insider Preview Build 17063 TCC/LE Support 7
adam_0 TCC/LE string replacement differing from cmd.exe TCC/LE Support 3
D Incorrect icon for TCC/LE prompt here, Windows 10 TCC/LE Support 5
B Run TCC without interactive logon TCC/LE Support 0
T WAD option /u on TCC LE 13.06.77 TCC/LE Support 2
B Copy command to set timestamp not working in TCC/LE TCC/LE Support 5
R WAD TCC/LE does not set %_ffind_files TCC/LE Support 1
P Window width TCC TCC/LE Support 3
A installer for latest tcc/le isn't working TCC/LE Support 0
M Any plans for an updated TCC/LE version TCC/LE Support 16
miXza-81 Fixed There is Batch breaking bug in TCC LE (x64) TCC/LE Support 9
M Getting started with TCC/LE TCC/LE Support 3
John A TCC/LE not finding files in the c:\windows\system32\ directory? TCC/LE Support 4
Tim Rowe How to? TCC/LE colour not working with RSpec TCC/LE Support 14
R converting from NT to TCC/LE TCC/LE Support 3
jbanaszczyk [Q] How to retrieve / set current TCC/LE language TCC/LE Support 1
T C# Process.Start() never ends when starting TCC/LE process? TCC/LE Support 5
R WAD TCC LE pipe fails TCC/LE Support 6
M TCC LE x64 13.0 crash in Win 8 Pro 64-bit TCC/LE Support 0
A ftp on tcc/le TCC/LE Support 2
B What are the TCC settings that will allow maximum cmd.exe compatibility? TCC/LE Support 11
R TCC/LE attrib +/- C? TCC/LE Support 6
S Just wondering what TCC/LE 13.05.68 fixed TCC/LE Support 1
R TCC/LE steals the .btm association? TCC/LE Support 1
S Fixed TCC-LE 13.05.65 x64 "option" command tabs broken TCC/LE Support 4
rconn News TCC/LE 13.05 Released TCC/LE Support 0
F WAD Different value for %~dpfsI in TCC/LE TCC/LE Support 2
Charles Dye ? command, TCC/LE vs. supported TCC/LE Support 3
B TCC/LE prompt here TCC/LE Support 1
G Pin TCC/LE to task bar and start menu TCC/LE Support 6
jason404 A particular program that I like to use no longer works in TCC/LE TCC/LE Support 25
rconn News TCC/LE 13.04.56 Released TCC/LE Support 0
rconn News TCC/LE 13.04.55 Released TCC/LE Support 0
F Problem with TCC window colors TCC/LE Support 3
rconn News TCC/LE Version 13.03.45 Released TCC/LE Support 0
mfarah Things from the full TCC that I'd like to see in TCC/LE. TCC/LE Support 7
N how to terminate tcc/le using /h TCC/LE Support 15
rconn News TCC/LE Version 13.03.40 Released TCC/LE Support 0
rconn News TCC/LE 13.03.39 Released TCC/LE Support 0
R How to? Add TCC Open command box here to context menu TCC/LE Support 2

Similar threads