Reputation: 4366
If I have the following select cases:
Select Case var
Case 1
doA()
Case 2
doB()
Case 3
'empty
End select
What impact does this empty select case have? Is there an official/legit way to define an empty select case?
Upvotes: 1
Views: 1570
Reputation: 38755
Having an empty Case (marked by a suitable comment) is the correct way to deal with cases like:
Select Case DayOfWeek
Case Sat
doSaturday
Case Sun
' nothing to do for sundays
Case Else
doWorkingDay
End Select
Here, omitting the Sun Case would be an error.
Upvotes: 4
Reputation: 359936
Why wouldn't you omit that case entirely?
Select Case var
Case 1
doA()
Case 2
doB()
End select
Upvotes: 2