Library tutorials & articles
Select Case statement
- Introduction
- Syntax
- Usage
Syntax
The Select Case statement uses the following syntax:
Select Case testexpression
Case expressionlist1
statements
Case expressionlist2
statements
Case Else
statements
End Select
testexpression is a single expression, that is evaluated at the top of the list. The expressionlist then lists possible conditions and if the testexpression is equal to this case, the code in that section is run.
Related articles
Related discussion
-
VB6 Runtime error 381 subsript out of range Error
by Uncle (2 replies)
-
passing and reading parameters from using Shell
by jigartoliya (0 replies)
-
Convert C++ code to VB6
by mawcot (4 replies)
-
listbox scrollbar
by Dennijr (10 replies)
-
Can you describe Above simple VB6 code?
by pramodmca09 (0 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
You want Case "SomeString", "NoString".
This below code segment throws casting exception
Select Case str1
Case "SomeString" Or "NoString"
Response.Write("OK")
Case "SmallString" And "BigString"
Response.Write("AND here")
End Select
Can you please explain the structure of Case statement in detail ?
Thanx in Adv.
If you put the Case Is statement first, will it run this message box and not look at the others?
This thread is for discussions of Select Case statement.