Visual RPG 9.0 Language Reference  

ENDSR

Defines the end of a subroutine or event-handler.

ENDSR

Remarks

ENDSR must be the last statement in the subroutine.

Conditioning indicator entries are not allowed.

The ENDSR causes a subroutine to branch back to the statement immediately following the EXSR operation, unless the subroutine is an event handler, in which case control goes back to the event cycle.

Example

//Subroutine to get customer details record with Endsr used to define an exit.

BegSR GetDetail
 ReadRand CustMaster CustNumber NotFnd(*IN99)
 If *IN99
  CustNbr = 0
  CustName = ''
 Endif
EndSR

See Also

BEGSR
EXSR
HIDE
SHOW
UNLOAD