Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: select switch cases
..... break case "My Name": ..... break endswitchI got error message on this block, because switch can use only integer variable. Is there is any way to do "case" on strings?
switch @true case var == "Paul" break case var == "Alice" break endSwitchOr you could also do (less elegant)---convert it to an integer:
var="fred" list="paul fred sam alice" paul=1 fred=2 xx=ItemLocate(var,list," ") switch xx case paul break case fred break case 3 ; sam break case 4 ; alice
Article ID: W13195
Filename: Switch with a Variable Name.txt
File Created: 2003:07:08:11:49:08
Last Updated: 2003:07:08:11:49:08