A Dynamic Collection

Visual LANSA

A Dynamic Collection

This example first creates a dynamic collection of buttons:

 

DEFINE_COM class(#PRIM_KCOL<#prim_phbn #STD_NUM>) name(#BUTTON_COLLECTION) reference(*DYNAMIC)  STYLE(Collection)

By specifying reference(*DYNAMIC) we are telling LANSA not to create the collection when the form is loaded (as happens with an ordinary DEFINE_COM statement), but to create it only when a reference is explicitly made to it. The benefit of explicitly creating the collection is that later on we will be able to destroy it at any given time by setting the reference to it to *NULL.

Ý Example 5: Dynamically Create Buttons