1.

Solve : case statement??

Answer»

Is there such a thing as case statement in a batch file? I CHECK the web and they only use if statement.

thanksplease explain what you mean.
LIKE case sensitive?

Quote from: locbtran on May 20, 2009, 08:50:45 PM

Is there such a thing as case statement in a batch file? I check the web and they only use if statement.

thanks
no. 'case' is just a nicer if/else. Therefore, all you really NEED is if/else. if you really really need case support, use *nix SHELLS, eg bash, or other languages that GIVES you this kind of support.
Quote
case "$var" in
value1)
commands;
;;
value2)
commands;
;;
*)
commands;
;;
esac

That's an example like I used to use in my shell scripting days.


Discussion

No Comment Found