Procedure someproc *-- Evan would replace * Local ... *-- with Local luReturnValue, ... With This If !.GetValidDateRanges() *-- Evan would replace * Return .F. *-- with luReturnValue = .F. Endif * Some other code ... Select ... From ...Into Array .arrItems If Type('.arrItems[1,1]')#'N' *-- Evan would replace * Return .F. && No items *-- with luReturnValue = .F. Endif For ix=1 To Alen(.arrItems,1) If .arrItems[ix,2] = 'somecondition' *-- Evan would replace * Return .SomeOtherProc(ix) *-- with luReturnValue = .SomeOtherProc(ix) Endif If .arrItems[ix,3] = 'somecondition2' *-- Evan would replace * Return .SomeOtherProc2(ix) *-- with luReturnValue = .SomeOtherProc2(ix) Endif Endfor * Some other code where also there are few other returns ... Endwith *-- Evan would add here: RETURN ( luReturnValue ) EndprocThis accomplishes EXACTLY the same end result with a SINGLE EXIT POINT, and does NOT slow the code down or make the code ANY LESS READABLE. It also does not restrict breaking the code down into "handler routines" as you suggest (which is what I also do -- great minds -g-).
>Procedure someproc >Local ... >With This > If !.GetValidDateRanges() > Return .F. > Endif > * Some other code ... > Select ... From ...Into Array .arrItems > If Type('.arrItems[1,1]')#'N' > Return .F. && No items > Endif > For ix=1 To Alen(.arrItems,1) > If .arrItems[ix,2] = 'somecondition' > Return .SomeOtherProc(ix) > Endif > If .arrItems[ix,3] = 'somecondition2' > Return .SomeOtherProc2(ix) > Endif > Endfor > * Some other code where also there are few other returns ... >Endwith >Endproc >>This already has the code broken down into many handler routines. From my POV it's easier to follow this code then to follow 'one exit point' counterpart.