Step 7 Create Event Routines for the Push Buttons

Visual LANSA

Step 7. Create Event Routines for the Push Buttons

FRM015 - Getting Started with Forms Programming

In this step you will add event routines for each push button. An event routine is a routine that is invoked when the user or the program triggers a specific action. You will add a event handling routine to be called when the user Clicks on each push button.

1.  Select the Source view in the Editor. You should see code similar to the following:

     For the moment just ignore the existing code.

2.  Next create an event routine (EVTROUTINE/ENDROUTINE command pair) for the Clear button to handle the 'Click' event:

a.  Select the Design tab and select the Clear button.

b.  Right-click, select the Events:Push Button option and then the Click Event.

c.  A new event routine is added for the Clear push button in the Source tab as shown below:

     Notice the format of the event routine names. Event routine names are always formatted as

COMPONENT.EventName (#Clear.Click).

 

3.  Next add a Click event to the Hello and World buttons.

     Your event routines should now look like this:

Evtroutine Handling(#HELLO.Click)
Endroutine
Evtroutine Handling(#WORLD.Click)
Endroutine
Evtroutine Handling(#CLEAR.Click)
Endroutine