(The following is a brief description for those that don't know the subject):
Some time ago someone at Microsoft have the unfortunate idea to use the dot in a published example of this use, so the use of ECHO. to display blank lines is widely known. The problem with this character is that the dot is used in a standard way by the command interpreter to separate the filename and the extension so, for example, ECHO.EXE or ECHO.BAT commands may confuse the novice and indeed may produce different results depending on OS version, in particular if original MS-DOS command.com (not cmd.exe) is used.
Although any unused special character may be used for this purpose, certain characters are better than others. The best choice would be a character that is NOT used for other purposes in a Batch file, or that is used for a similar purpose. I used to include a slash to display blank lines: ECHO/ and variables: ECHO/%VAR% based on the idea that the slash is the standard character used in commands for command options. The problem happen when the variable value is a single question-mark character: SET VAR=? because in this case ECHO/%VAR% command will show the echo help description (as jeb appropriately indicate).
jeb used to include a left parentheses: ECHO(; the problem is that this character IS used with other important purpose in Batch files and an unclosed left parentheses may confuse not just a human being, but also an application developed to check the balance of parentheses in a Batch file (unless ECHO( is managed as special case). Note that unbalanced parentheses is a common mistake of novice programmers, and that you just confuse they even more if you try to explain them why this line:
Code: Select all
for /L %%i in (1,1,%limit%) do (echo(!Array%%i!))
Is WRONG, but the following one is RIGHT!
Code: Select all
for /L %%i in (1,1,%limit%) do (echo(!Array%%i!)
I looked then at the Batch standard delimiter characters besides the space: comma, semicolon and equal-sign. Of these three, I choose the equal-sign not just because it is the most visually appealing, but also because ECHO=Any message command resembles the standard command to show a message with no advance to new line: SET /P =Any message < NUL.
In conclusion, I propose the equal-sign as the standard character to display blank lines and empty variables in ECHO command. What do you think?