if...then...else structure

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to exit from it prematurely? As it is now, I have to wrap the structure if a try...catch..end try structure then exit the try. Why did MS delete the exit if from vb.net

polynomial5d
 
Because that's not the way structured exception handling works. I take
it you're using VB.NET, in which case the older On error goto error
handling is still supported (although not recommended). If you find
the need to exit your exception handler, perhaps you need nested
exception handlers or multiple exception handlers where you're trying
to get away with using only 1? The code automatically exits after the
last statement in the catch block, and then code in the finally block
executes (if any). You might want to post some sample code to get
recommendations on how to handle the exceptions you're having problems
with.

-- Mary
 
I'm afraid I didn't explain myself very well, Mary. It's the if..then..else structure that I want to exit from under certain conditions. However, exit if is no longer supported. I was asking if there is an alternative way. I only wrap the try..catch..end try structure around it because I can exit the structure with exit try, which is supported. Is there a more elegant way to do this

polynomial5

----- Mary Chipman wrote: ----

Because that's not the way structured exception handling works. I tak
it you're using VB.NET, in which case the older On error goto erro
handling is still supported (although not recommended). If you fin
the need to exit your exception handler, perhaps you need neste
exception handlers or multiple exception handlers where you're tryin
to get away with using only 1? The code automatically exits after th
last statement in the catch block, and then code in the finally bloc
executes (if any). You might want to post some sample code to ge
recommendations on how to handle the exceptions you're having problem
with

-- Mar

On Sun, 28 Mar 2004 02:06:05 -0800, polynomial5
 
wrap in a function and return
I'm afraid I didn't explain myself very well, Mary. It's the if..then..else structure that I want to exit from under certain conditions. However, exit if is no longer supported. I was asking if there is an alternative way. I only wrap the try..catch..end try structure around it because I can exit the structure with exit try, which is supported. Is there a more elegant way to do this?

polynomial5d

----- Mary Chipman wrote: -----

Because that's not the way structured exception handling works. I take
it you're using VB.NET, in which case the older On error goto error
handling is still supported (although not recommended). If you find
the need to exit your exception handler, perhaps you need nested
exception handlers or multiple exception handlers where you're trying
to get away with using only 1? The code automatically exits after the
last statement in the catch block, and then code in the finally block
executes (if any). You might want to post some sample code to get
recommendations on how to handle the exceptions you're having problems
with.

-- Mary
 
OIC -- well, goto is still supported in VB.NET. Although it sounds
like it's more of a "formulating your logic" issue. You can always
leave the Else blank to jump out of an If ElseIf block or else use the
Select Case statement if your Ifs are getting too complex.

-- Mary
 
Back
Top