&<img src="../resources/images/opentocr.png" title="Open Contents list" border="0"&>
You are here:

Redefine the Ancestor's Methods

To extend the functionality of the date display reusable part #EOEXAM04, modify the ancestor's methods in the inheriting reusable part. You do this by using a method routine with *REDEFINE option.
The ancestor date display reusable part #EOEXAM04 contains a method routine ValidateDate which validates the dates. Suppose you want to extend the date validation to ensure that the day is a week day.
To see how this works add a method routine to the inheriting reusable part #EOEXAM05 which overrides ValidateDate method in the ancestor:
 
MTHROUTINE name(ValidateDate) options(*REDEFINE)
ENDROUTINE
Make the redefined validation routine check whether the date is a weekday and show the day of the week. You can copy this code from the Source for Inheriting Date Display Reusable Part below.
Compile and execute your reusable part.
Source for Inheriting Date Display Reusable Part
FUNCTION options(*DIRECT)
BEGIN_COM role(*EXTENDS #EOEXAM04) HEIGHT(29) WIDTH(492)