how do people feel about exit function from loop
- From: "greg" <greg@xxxxxxxxxx>
- Date: Mon, 23 Jul 2007 16:34:18 -0500
In general,
How do people feel about using exit function from inside of a loop?
Is it bad practice?
So for example. The same code written 2 ways. Is the #1 bad code?
thanks
1)
For intCountElement = 1 To objConditionalFormats.Count
Set objFormatData = objConditionalFormats.Item(intCountElement)
If objFormatData.Format = strFormat Then
Set ConditionalFormatting_FindFormatData = objFormatData
Exit Function
End If
Next intCountElement
2)
Set ConditionalFormatting_FindFormatData = Nothing
intCountElement = 1
While ((intCountElement <= objConditionalFormats.Count) And
(ConditionalFormatting_FindFormatData Is Nothing))
Set objFormatData = objConditionalFormats.Item(intCountElement)
If objFormatData.Format = strFormat Then
Set ConditionalFormatting_FindFormatData = objFormatData
End If
intCountElement = intCountElement + 1
Wend
.
- Follow-Ups:
- Re: how do people feel about exit function from loop
- From: Tony Proctor
- Re: how do people feel about exit function from loop
- From: greg
- Re: how do people feel about exit function from loop
- From: Michael C
- Re: how do people feel about exit function from loop
- From: Larry Serflaten
- Re: how do people feel about exit function from loop
- From: John K.Eason
- Re: how do people feel about exit function from loop
- From: dpb
- Re: how do people feel about exit function from loop
- From: Ken Halter
- Re: how do people feel about exit function from loop
- From: Jim Mack
- Re: how do people feel about exit function from loop
- From: Mike Williams
- Re: how do people feel about exit function from loop
- From: Robert Morley
- Re: how do people feel about exit function from loop
- Prev by Date: Re: Parent object question
- Next by Date: Re: Project editor
- Previous by thread: Please help translate that from C#
- Next by thread: Re: how do people feel about exit function from loop
- Index(es):
Relevant Pages
|