For the first time in my programming career i discovered a language which can have whitespace in identifier names.
Guess which language it is?
Hint: I learned it – or so i thought – long before Pascal, C and Perl, but a bit after GW-BASIC.
It’s the MS-DOS batch file language.
In all the languages i know, variable assignment operator is = or something similar (it’s := in Pascal). Any number of spaces are allowed before and after it; Curiously, in Microsoft’s own QBasic it is encouraged and even automatically inserted if you try to write something like A=42.
But in DOS batch files, if you write this:
SET A = 42
ECHO %A%
You’ll get nothing.
But this will work:
SET A = 42
ECHO %A %
And guess what, it will print ‘ 42‘, with a space in the beginning.
Wow, wow, wow, wow, unbelievable.
Where the hell in 2007 did you meet an MS-DOS shell???
Thank god they got it straight in all versions of WSH…
I wrote a custom post-build action for a Visual Studio project. It needs to run a few commands and copy some files when certain conditions are met after compilation.
If i would to it for myself, i’d write it in Perl, of course, but i had to distribute it to programmers who don’t have Perl installed.
(This last sentence should be an oxymoron, but unfortunately it is not…)
I never studied WSH properly. VB.NET is a pretty good language, but VBScript is a bloody mess in its own right. It is better than BAT, but i didn’t want to waste time on learning how to copy files with it …