I was taught a LONG time ago (before most of you were born, I'm sure) that there should be one entry point and one exit point to a proc/pgm/whatever. Being new to VB, I started using the the following "template" which is similar to what I've used in other languages:
Private Sub xxx_GotFocus()
On Error GoTo ErrRtn:
If Not blnEditRec And Not blnNewRec then GoTo ProcExit:
.
.
ProcExit:
Exit Sub
ErrRtn:
Call DisplayErrMsg(xxx, yy, zzz)
Resume ProcExit:
End Sub
Do you guys feel it's an OK practice to use:
"If Not blnEditRec And Not blnNewRec Then Exit Sub"
in place of the GoTo ProcExit:?
I actually just started implementing a CallStack which
REQUIRES I have 1 entry/exit in order to properly maintain the stack, but I just wondered in general about the process.
Any and all comments welcome.
Private Sub xxx_GotFocus()
On Error GoTo ErrRtn:
If Not blnEditRec And Not blnNewRec then GoTo ProcExit:
.
.
ProcExit:
Exit Sub
ErrRtn:
Call DisplayErrMsg(xxx, yy, zzz)
Resume ProcExit:
End Sub
Do you guys feel it's an OK practice to use:
"If Not blnEditRec And Not blnNewRec Then Exit Sub"
in place of the GoTo ProcExit:?
I actually just started implementing a CallStack which
REQUIRES I have 1 entry/exit in order to properly maintain the stack, but I just wondered in general about the process.
Any and all comments welcome.