Are variables declared in a case statement local to that case statement –
For example, in the following code, is it safe to use z like this? Or is the compiler just placing z at the procedure scope?
Select Case x Case 6 Dim z As Integer = 6 Case 7 Dim z As Integer = 7 End Select
It’s safe to do that. You can test it by trying to compile the following:
And noting that you’ll get a compile error.
Of course it cuts down on readability IMO. Maybe you should declare it at the beginning of the procedure anyway.