Example 1 Create a Keyed Collection

Visual LANSA

Example 1: Create a Keyed Collection

This example form shows how to create a collection of employees and  to add items to the collection. In this example the collection is used simply like an array.

When you type in an employee name and click on the Save button, the employee name is saved in a collection.

When you click on the Show button, all employees entered in the collection are displayed in a message box.

When the application ends, the entries in the collection are cleared.

Define the Collection

Add Items to the Collection

Work with the Collection Items

Source Code for Collection Example 1

Ý 6.22.3 Keyed Collections