One time while I am making a Batch game because I am bored, I used a comment like this:
Code: Select all
@echo off
%== Main loop: check for win and lose condition ==%
But when I executed this: This happened...
Code: Select all
'check' is not recognized as an internal or external command,
operable program or batch file.
So I tried to experiment:
Code: Select all
%=: @echo off
%=: main 2>nul
%=: for /l %%A in (1,1,10) do (
%=: for /l %%B in (1,1,10) do (
%=: if "%%A"=="%%B" (
%This is a good comment : echo(%%A == %%B
%=: )
%Hmm... Another comment here: )
%=: )
%=: pause
%=: goto :main
And the code works as expected. The main part should have 2>nul because this is treated as both a command and a label.
I do not know why is this happening, but I expect that you know this already.
Also I expect that this does not have any applications. I tried hybridization, but % is rarely used as a comment.
Meerkat