By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,363 Members | 1,791 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,363 IT Pros & Developers. It's quick & easy.

Compiler support for "Exit For"

P: n/a
Hello,
does anybody know if the built in support for the "Exit For" statement is
just a left over from earier versions of VB and therefore inefficient or if
it's truely a VB.NET language feature?
The reason I ask is because even though the "On Error Goto" statement is
still available in .NET, if you use it, it wraps a Try/Catch block around
each line of code in that routine from what I understand. If "Exit For" does
anything as inefficient as that, I certainly wouldn't want to use it.

Can someone in the know address this?

Thanks
Steve
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Steve Long" <St**********@NoSpam.com> schrieb:
does anybody know if the built in support for the "Exit For" statement is
just a left over from earier versions of VB and therefore inefficient or if it's truely a VB.NET language feature?
It's truly a language feature and there are no reasons for removing it in a
future version. It just performs a jump.
The reason I ask is because even though the "On Error Goto" statement is
still available in .NET, if you use it, it wraps a Try/Catch block around
each line of code in that routine from what I understand.


Unstructured error handling is a language feature too. It's part of the
language and it's sometimes a nice shortcut. You should not matter about
the IL that is generated by the compiler too much.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.