change: return can be used in methods or in sub-routines perhaps next revision #COMMAND RETURN #IF (!b & 4) // are we within a Procedure/function #IF (!Zl & 2) #REM #ERROR DFERR_COMP_OBSOLETE_UNSUPPORTED_FEATURE Old Style Usage: Possible gosub return inside of method #ENDIF Procedure_Return !1 // we are returning from a method #ELSE // tells us what we need to fix. #IF (!Zl & 2) #REM #ERROR DFERR_COMP_OBSOLETE_UNSUPPORTED_FEATURE Old Style Usage: Gosub style/Return s/b Gosub_return #ENDIF #IF (!Zl & 1) // if relaxed... Gosub_Return !1 !2 // we are doing an old style sub-routine return #ELSE Procedure_Return !1 // we are returning from a method.. will gen an error #ENDIF #ENDIF #ENDCOMMAND change: if within a method declare an error. Force use of gosub_return. This catches errors where developer types return instead of procedure_return.
#IF (!b & 4) // are we within a Procedure/function #IF (!Zl & 1) // if relaxed... #REM WARNING 4388: Old Style Usage: s/b gosub_return Gosub_Return !1 !2 !3 !4 !5 !6 !7 !8 !9 // we are doing an old style sub-routine return #ELSE #ERROR DFERR_COMP_OBSOLETE_UNSUPPORTED_FEATURE Old Style Usage: s/b gosub_return #ENDIF #ELSE // we are not within method. Normal gosub/return usage Gosub_Return !1 !2 !3 !4 !5 !6 !7 !8 !9 // we are doing an old style sub-routine return #ENDIF