Work with the Collection Items

Visual LANSA

Work with the Collection Items

The click events of the two buttons to move the child forms to right and left use two different ways of working with items in a collection.

The click event of the Move all Form Bs Right button invokes a MoveRight method of Form B for all forms in the collection:

Invoke Method(#formBs<>.MoveRight)

 

To work with all items in the collection specify a blank key for the collection:

#CollectionName<>

 

The click event of the Move all Form Bs Left uses a For/EndFor loop to iterate through the items in the collection and to move them to the left:

For Each(#Current) In(#FormBs)

Change Field(#NEW_LEFT) To('#Current.Left - 5')

Set Com(#Current) Left(#New_Left)

Endfor

 

Also see

6.19 Multi-Form Applications

Ý Example 3: Collection to Manage Forms