Thread
:
What's Exit Sub for???
View Single Post
#
3
(
permalink
)
10-01-2007, 08:10 AM
ccoonen
PT Staff
Awards Showcase
Total Awards
: 4
Join Date: Jun 2007
Location: Wisconsin
Posts: 317
iTrader: (
0
)
Also works for other loops - like if you wanted to be optimized you could do
Code:
For Each DR as DataRow in DataTable If DR.ProductID = 34 MsgBox(DR.ProductName) Exit For End If Next
This woulid exit out of the for and save all yoru cpu cycles
__________________
Day Cares
|
Golf Courses
|
Disc Golf Courses
|
Campgrounds
|
Ice Rinks
|
Paintball Fields
|
Dentists
|
Plastic Surgeons
|
Aging Jokes
Catholic Churches
|
Lutheran Churches
|
Methodist Churches
|
Episcopal Churches
|
Clean Jokes
Last edited by TeraTask : 12-24-2007 at
07:45 PM
. Reason: Added code tags
ccoonen
View Public Profile
Send a private message to ccoonen
Find all posts by ccoonen