Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Using select statements

Reply
 
Old 10-23-2008   #1 (permalink)
Andrew Falanga


 
 

Using select statements

Hello,

The MSDN article I found doesn't directly mention this and the example
doesn't show it so here's the question. Does VBScript support the
ability to use empty case "blocks?" For example, in C I'd do
something like:

int c;

scanf("%d", &c);

switch(c) {
case 0:
// do something important
break;
case 1:
case 2:
// do the same thing if c is 1 or 2
break;
}

Likewise in TCL I'd do something like:

gets stdin someInt

switch $someInt {
0 {
# do something important
}
1 -
2 {
# do the same thing if someInt is 1 or 2
}
}

Can I do this in VBScript by simply leaving the Case statement empty/
blank?

Thanks,
Andy

My System SpecsSystem Spec
Old 10-23-2008   #2 (permalink)
gimme_this_gimme_that


 
 

Re: Using select statements

someint = 2
Select case someint
case 0
case 1
case Else
MsgBox "1 or 2"
end select
My System SpecsSystem Spec
Old 10-23-2008   #3 (permalink)
gimme_this_gimme_that


 
 

Re: Using select statements

I don't know. You'll have to experiment and figure that out.
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Dynamic statements? PowerShell
test-path and if statements within my foreach loop PowerShell
Breaking change in CTP evaluation of statements? PowerShell
ADO.Net / Multiple SQL Statements in One Command .NET General
Are These Statements True? Vista installation & setup


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46