...

Visual Basic Qns on "Select Case"

vbBlurry
11-19-2002, 07:13 AM
hi! do anyone know whether how to break out from a select case?

thanks! :)

oracleguy
11-19-2002, 05:45 PM
Well I'm not sure how if you wished it to continue running code that was past the select block. But if you didn't want to run any code in the sub past the block statement, you could just use 'Exit Sub'

Maybe there is a 'Exit Select'? I know there is an 'Exit Do'

rcreyes
11-19-2002, 05:47 PM
There is no KEYWORD to exit from the Select Case, however calling a function within the Case statement, is almost the same as exiting, for example:

Dim I
I=2
select case I
case 1
DisplayMsg("Apple")
case 2
DIsplayMsg("Banana")
case else
DisplayMsg("Orange")
End Select

Function DisplayMsg(s)

Msgbox s

End Function


Thanks,
Ray

vbBlurry
11-20-2002, 07:42 AM
thanks for your help..is really useful



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum