Summary

Visual LANSA

Summary

FRM015 - Getting Started with Forms Programming

Important Observations

  • As you set component properties (names, captions, and so on, in the Details tab) the DEFINE_COM statements are updated in the RDML code. Alternatively, you can directly edit the DEFINE_COM statements.
  • There are many different ways to perform the same operation, such as using commands in a ribbon or context menu options.
  • There are many ways of coding RDML statements to achieve the same results. For example, the following two statements will produce the same result:

CHANGE FIELD(#STD_TEXT) TO(*BLANKS)
#STD_TEXT := *BLANKS
 

  • The DEFINE_COM commands may be hidden using the editor settings.
  • The F2 Feature help provides information about component properties, events and methods
  • If you know LANSA functions, you need to understand there is a fundamental difference between forms and functions in the programming paradigm. Functions are procedural programs that execute in a "top to bottom" fashion. Forms use an event-driven paradigm based on graphical user interfaces. The form waits for a specific event to occur and then executes the event. Once the event has completed, control is passed back to the interface. Hence, the location of the event routines in a form's code is not important to the execution of the program.

Tips & Techniques

  • Review all of the editor settings to determine the options that you want to use when working in Visual LANSA.
  • When editing source code, using the Auto Hide tab feature will enable the maximum amount of space for viewing your source code.
  • F2 feature help provides details about components. The F1 online help will provide details about the user interface, commands, and options.
  • Use the dialog box launcher in the Compile group in the ribbon if you need to specify the compile settings. If you submit compiles using Compile command, the compile options will simply default to the last values set in the Compile options dialog.

The basic rules you need to remember when writing code:

  • Only one command is allowed per line in the editor.
  • You cannot have any leading blanks before a command.
  • A command may have no parameters (as in END_COM) or may have many parameters (as in BEGIN_COM).
  • Many command parameters are optional.
  • Parameters may have one or more values (as in ROLE(*EXTENDS #PRIMFORM)). A blank space is used to separate values in a list.
  • When coding parameters, do not leave a space between the parameter keyword and the opening bracket. For example, OPTIONS(*DIRECT) or OPTIONS( *DIRECT ) are correct, but OPTIONS (*DIRECT) is not correct.
  • When parameters use their default values, the parameters are not explicitly shown in the command, but they can be viewed in the Command Assistant tab. Select the line of code and use F4 to display the Command Assistant tab. It is often convenient to float and resize this tab so that the command parameters can be seen more easily.
  • An asterisk * in the first position of a line is used for a comment. You can use the short cut keys CTRL+W and CTRL+Shift+W to comment or uncomment a single line or selected block of lines.

What You Should Know

  • The basic structure of the code in a form
  • FUNCTION
  • BEGIN_COM
  • DEFINE_COM
  • EVTROUTINE
  • ENDROUTINE
  • END_COM
  • How the form and components are related to the source.
  • How to create a form.
  • How to add components to a form.
  • How to change the properties of a component on a form using the Details tab.
  • How to define events for a component.
  • How to compile and execute a form.
  • The basic structure of LANSA commands.
  • How to display feature help.
  • How to find intrinsic methods.
  • How to use intrinsic methods.
  • How to use the RDML/RDMLX commands.
  • CHANGE
  • ASSIGN
  • How to write a Boolean expression.