ENDFUNC defines the end of a function.
ENDFUNC
ENDFUNC must be the last statement within a subroutine that is preceded with a BEGFUNC and also contains a LEAVESR.
BEGFUNC
LEAVESR