8 16 2 MTHROUTINE Examples

LANSA Technical

8.16.2 MTHROUTINE Examples

You can define a user-defined method that instructs a form to fetch details from a file:

MTHROUTINE Name(GetInfo) Help('This method gets the details of the employee.')
    FETCH Fields(#detflds) From_File(pslmst) With_Key(#empno)
ENDROUTINE 
 

An owner form can now instruct the form to perform this action by invoking the method:

INVOKE #frmDetail.GetInfo
 

For an example of how to pass values to a method routine, see 8.6.3 DEFINE_MAP in MTHROUTINE.