7.38 ENDROUTINE
The ENDROUTINE command is used to indicate the end of:
- a subroutine (which starts with a SUBROUTINE command).
- an event routine (which starts with an EVTROUTINE command).
- a method routine (which starts with a MTHROUTINE command).
- a property routine (which starts with a PTYROUTINE command).
Every SUBROUTINE, EVTROUTINE, MTHROUTINE or PTYROUTINE command must have one and only one ENDROUTINE command.
When an ENDROUTINE command is executed control is returned to the logic that invoked the routine:
- Executing an ENDROUTINE command in a SUBROUTINE returns control to the command following the EXECUTE command that caused the subroutine to be executed.
- Executing an ENDROUTINE command in an EVTROUTINE, MTHROUTINE or PTYROUTINE returns control to the control logic that invoked the routine. The control logic will then decide what to do next based on the way in which the routine was invoked.
Portability Considerations |
Subroutines that are nested inside one another are not supported in the current release of Visual LANSA. This is a very rarely used coding technique and thus unlikely to cause any problems. In the event of problems simply un-nest the subroutine(s) involved and recompile. |
Also See
ENDROUTINE --- no parameters ---------------------------------|