Step 8 Add Logic to the Hello Button Click Event

Visual LANSA

Step 8. Add Logic to the Hello Button Click Event

FRM015 - Getting Started with Forms Programming

1.  Add the line of code shown, highlighted inred, italic to the Click event for the Hello button (it adds the word 'Hello ' to the #STD_TEXT field):

EVTROUTINE HANDLING(#HELLO.Click)
#STD_TEXT:= #STD_TEXT + 'Hello '
ENDROUTINE

 

     The AutoComplete prompter shows up as you start to type. You can use it to select the command and the parameter values.

     Note that there is a space between the word Hello and the closing quote.

Some Things to Note About Editing Code

  • The editor is completely free format. The syntax will be checked as you enter the command. A red triangle beside a command indicates that a warning or error message can be displayed. To display the message, click on the red triangle.
  • You can only enter one command per line.
  • Your commands and their parameters can be in uppercase or lowercase.
  • The definitions of the components (that is, buttons, fields and so on) on your form are stored at the start of your program as a series of DEFINE_COM (Define Component) commands. These commands can be hidden or displayed using the plus sign in front of them or using the editor settings.
  • Normally, you will change the DEFINE_COM commands only by using the form layout or by altering the component's property sheet even though you can edit the DEFINE_COM statements.