6 9 2 What Is Different Between Event Driven and Procedural Programs

Visual LANSA

6.9.2 What Is Different Between Event-Driven and Procedural Programs?

There are some fundamental differences in how event-driven and procedural programs are designed and executed:

  • In Visual LANSA you create the graphical user interface using controls which have powerful built-in functionality such as tree views, tabbed folders, video and animation.

    In a LANSA function you have very limited graphical controls in order to accommodate non-graphical platforms.
  • In Visual LANSA you create the interface of the program graphically by dragging controls to a form which corresponds to a window of the application when it is running.

    In a LANSA function you create the interface programmatically using DISPLAY, REQUEST and POP_UP statements.
  • In an event-driven program you write code for the individual controls, for example a button. So your application consists of many event routines. These event routines are executed individually which makes it possible for the individual controls on the form to respond dynamically to user actions.

    A LANSA function is one program which runs from the beginning to the end. A screen is always processed as a whole so it cannot change dynamically.
  • When executing Visual LANSA applications you perform actions directly on objects.

    In Universal UI functions you first choose an action, such as Add, which sets a mode in the program and then work on the object.
  • Also see

    The Code Is Always Associated With a Component

    Modes Are Not Needed because Actions Are Performed Directly

    The Code for a Mode Often Becomes an Event Routine

    Sequence of Actions Is Free

    You Create the Interface Graphically

    Ý 6.9 Event-Driven Programs