Add the possibility to comment the ENDIFF

It seems to be convenient to have the possibility to comment the ELSE and ENDIFF on the same line:
iff "%a" == "s1" then
***
iff isdir "%b" then
***
else %b
***
endiff %b
***
else %a
***
iff %c LE 7 then
***
else %c
***
endiff %c
***
endiff %a

The idea is to make the TCC accepting and ignoring the "parameters" of the ELSE and ENDIFF clauses. Now such commenting requires a combination of the 'command separator symbol' with the REM command, which seems ugly and increases the file's size.
 
Last edited:
May 20, 2008
9,153
58
Syracuse, NY, USA
Lines beginning with colons are labels -- GOTO and GOSUB targets. A double colon is a fairly useless label, but can be used as a comment.
That's how I always thought of it. So it was a bit of a surprise to see it work at the end of an IFF, ELSE, or ENDIFF line. In my brief testing, it works in those places with or without "&" and REM behaves similarly.
 
Reactions: Dmitry L. Kobyakov
Jan 12, 2014
290
7
Switzerland, SO
Hi Dmitry

I could not find anything about the '::' in the TCC's help…

In my version here (24.00.36) I could find the following line in the Help for REM:

You can also place a comment in a batch file by starting the comment line with two colons [::]. In essence this creates a batch file "label" without a valid label name.


Greetings
 
There are the words 'starting the line' there. The statement does not mean the double colons will work so anywhere in a command line. A command line starting with 'REM ' is ignored as commment, but the 'REM ' after some characters in a line will constitutes a part of a command. The commands
echo the test for rem is OK
echo the test for :: is OK

display all the phrases, not the words before 'rem' or '::'.