8 5 2 DEFINE_EVT Examples

LANSA Technical

8.5.2 DEFINE_EVT Examples

This command defines an event called ADRESSCHANGED in a form:

define_evt name(ADDRESSCHANGED) help('This event tells that the #ADDRESS1 field on this form has changed.')
 

The form also contains a SIGNAL command which triggers this event when the contents of the #ADDRESS1 field on the form are changed:

EVTROUTINE HANDLING(#address1.changed)
   signal event(ADDRESSCHANGED)
ENDROUTINE 
 

In this way the form where these commands have been specified can communicate to an owner form that the contents of the #ADDRESS field on it have changed. An owner form can react to this event by having an event routine for it:

EVTROUTINE HANDLING(#FormB.ADDRESSCHANGED)
   execute RfrshDtls
ENDROUTINE 
 

See also 8.6.2 DEFINE_MAP with DEFINE_EVT.