Rated
Read 113,108 times
Contents
Related Categories
Select Case statement - Introduction
Introduction
The Select Case statement is an alternative to the If...Then...Else statement.
It also makes code easier to read especially when testing lots of
different conditions. It also makes the code more efficient.
James first started writing tutorials on Visual Basic in 1999 whilst starting this website (then known as VB Web). Since then, the site has grown rapidly, and James has written numerous tutorials, articles and reviews on VB, PHP, ASP and C#. In October 2003, James formed the company Developer Fusion Ltd, which owns this website, and also offers various development services. In his spare time, he's a 3rd year undergraduate studying Computer Science in the UK. He's also a Visual Basic MVP.
Comments
Posted by HyperHacker on 12 Sep 2004
You want [i]Case "SomeString", "NoString"[/i]. -
Posted by jayatheerth on 17 Mar 2004
This below code segment throws casting exception
Select Case str1
Case "SomeString" Or "NoString"
Response.Write("OK")
Case "SmallString" And "BigString"
... -
Posted by HomeSite4u on 27 Jan 2002
If you put the Case Is statement first, will it run this message box and not look at the others?
|