Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

exit function

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
Is there an other way to leave a function in an If structure. Now I use GOTO that works. exit ?

Code:
If 
.......
GoTo endFunc
Else
.......
End If

endFunc:

End Function
 
There should not be a reason to leave an If, an If only happens once:

[tt]strA="A"
If strA="A" Then
'This will occur
Else
'This will not occur, however, you can
'include another If for when it does occur
If strA="" Then
End If
End If[/tt]

So in a way the answer is End If or another If.

 
There is a reason. I work in my first if statement with an array. He loops the array completely. Even when he math a value, he's overwriting the founded value.

 
Have a look at the Exit Function instruction.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top