I asked about the odd return from %[[ ]] when it was first added. Rex said that he was thinking in terms of return codes: 0 generally means success, and nonzero is failure.
And indeed the documentation for %[[ ]] mentions "exit status", though I didn't connect that with ERRORLEVELs.
I found it there too. IMHO, if it's going to stay as it is (TRUE -> 0) it should remain poorly documented. But in any case, what's it for? I can't think of a use for it that can't be done more easily otherwise.
This was added at the request of a corporate customer, and is definitely not going to be changed.
Perhaps if you gave me an idea of what you're really trying to do (other than misuse a special-purpose construct) I can suggest the right way to do it.
Ehhhh.
I don't need a need.
You told me there was something new. (in the help)
I went ahead and checked it out. (not much documentation)
I tried to envision what the Almighty might have been thinking of when going out of his way to deliver this gem (we did not know about any corporate account).
I was hoping for an elegant way to pre-calculate a boolean value without if / iff and use it multiple times in subsequent tests without having to repeat the boolean expression.
And then the only the @IF appeared to be able to test that boolean, (if's need '%bValue==1' which kinda spoils it),
and then the expected return seemed reversed.
Sure. frustrating. What else?
Are you really going to blame me for misunderstanding?
If so, are you really surprised that I went ahead and experimented without asking ?
If you want me to change existing behavior (and break existing batch files & aliases), then you need an exceptionally compelling argument.
"I saw it in the What's New (from a couple of years ago) and though I don't have a need for it I didn't like the way it was implemented" doesn't rise to the level of compelling.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.