Code Comparison

Visual LANSA

Code Comparison

The following tables outline the similarities and differences in the two applications.

1.  Both the function and the form start with a FUNCTION statement:

FUNCTION OPTIONS(*DIRECT)

LANSA Function

Visual LANSA form

N/A

A BEGIN_COM statement (with a matching END_COM statement in the very end) and several lines of DEFINE_COM statements

These statements define the form and the controls on it. They are inserted automatically when the interface is created. Normally you can ignore all the definition statements.

 

2.  Both the function and the form have a GROUP_BY statement:

LANSA Function

Visual LANSA form

A BEGIN_LOOP statement with a matching END_LOOP statement at the very end.

N/A. There is no loop structure. Event routines can be executed in any order.

REQUEST statement

N/A. The interface has been created graphically at design time.

 

3.  Both the function and the form have a FETCH statement to fetch details for the specified person. In the form the statement is in the Click event of the Fetch button.

LANSA Function

Visual LANSA form

SET_MODE TO(*DISPLAY) statement.

N/A. Modes are not used.

POP_UP statement

N/A. The interface has been created graphically at design time.

N/A. Screens cannot be modified dynamically.

 

Event routine executed every time a radio button is clicked which enables and disables fields according to marital status

IF_MODE IS(*CHANGE) structure performing database updates

Event routine executed when the Save button is clicked. It contains the same UPDATE statement as the corresponding IF_MODE IS(*CHANGE) structure.

IF_MODE IS(*DELETE) statement which deletes the record

Event routine executed when the Delete button is clicked. It contains the same DELETE statement as the corresponding IF_MODE IS(*DELETE) statement.

 

 

Ý 6.9 Event-Driven Programs