Step 8. Add Logic to the other Click events

In this step you will add the required code for each of the push button event routines.

When you have completed this step you will have added the three lines of code to implement the required action by each push button. Your code will look like the following:

* When the user clicks the Hello button, the word 'Hello' is concatenated to contents of the field STD_TEXT.

Evtroutine Handling(#HELLO.Click)

#STD_TEXT := #STD_TEXT + 'Hello '

Endroutine

* When the user click the World push button, the word 'World' is concatenated to the contents of the field STD_TEXT.

Evtroutine Handling(#WORLD.Click)

#STD_TEXT := #STD_TEXT + 'World '

Endroutine

* When the user clicks the Clear button, the contents of field STD_TEXT is changed to blanks

Evtroutine Handling(#CLEAR.Click)

#STD_TEXT := *blanks

Endroutine

 

1.  Add an ASSIGN statement to the Clear button Click event to set field STD_TEXT to blanks.

#STD_TEXT := *blanks

 

2.  This is an example of the ASSIGN statement. The statement implies the ASSIGN command, which is never actually written.

3.  Put the cursor on the #STD_TEXT statement and press F1 to review online help for the ASSIGN command. All LANSA help will be displayed in your default browser.

4.  Complete the World.Click event by adding the following statement:

#STD_TEXT := #STD_TEXT + 'World '

 

5.  Your finished code should look like the example above. There should be no red triangles showing in your code, which indicate a code error.

     In an event driven program, the order of the event routines is not important.