Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


Defining a dictionary collection. This collection stores instances of layout items identified by a control.

...

          Define_Com

...

Class(#Prim_dcol<#Prim_tblo

...

#Prim_ctrl>)

...

Name(#LayoutItems)

 Collection items can be created by assigning them to an existing reference or creating a new one as below.

...

     #LayoutItems<#Button1> <= (*New #Prim_TBLO)

 Collection items can be accessed using any object type that inherits from the class specified as the key.

...

     #LayoutItems<#Button1>.Manage <= #Button1

 All collection items can be addressed as follows. Here, all the layout items are being assigned a parent.

...

     #LayoutItems<>.Parent <= #LayoutManager

 The FOR command can also be used to iterate over the collection contents. The items will be returned in the order of the key value, which in this case is effectively the memory address of the key.

...

     For each(#LayoutItem) in (#Layoutitems)
     ...
     Endfor

To monitor for an event from any instance in the collection, <> can be appended to an EVTROUTINE. The COM_SENDER parameter will provide access to the instance firing the event.

In this example, the closing event on a collection of forms is monitored and an event is recorded.

...

     Evtroutine Handling(#Forms<>.Closing) Com_Sender(#Sender)
       #Com_owner.AddEvent(("&1 closed").Substitute(#Sender.Caption))
     Endroutine

Properties

Name

Description

AllowsDuplicates

AllowsDuplicates indicates whether the collection allows duplicates Inherited from Collection (PRIM_COLL)

Collects

The class of object to be collected

ComponentClassName

ComponentClassName is the name of the component's class. Inherited from Object (PRIM_OBJT)

ComponentMembers

ComponentMembers provides access to all the member components of this component Inherited from Object (PRIM_OBJT)

ComponentPatternName

ComponentPatternName is used to qualify the class of the component. Inherited from Object (PRIM_OBJT)

ComponentTag

Generic space allowing a value to be stored for the instance Inherited from Object (PRIM_OBJT)

ComponentType

ComponentType gives you access to the type information about the component Inherited from Object (PRIM_OBJT)

ComponentTypeName

ComponentTypeName is the fully qualified name of the component's class. Inherited from Object (PRIM_OBJT)

IsEmpty

IsEmpty indicates whether the collection contains any items. Inherited from Collection (PRIM_COLL)

IsOrdered

IsOrdered indicates whether the collection is ordered. Inherited from Collection (PRIM_COLL)

Item

Provides access to a particular item in a collection

ItemCount

ItemCount is the number of items in a collection Inherited from Collection (PRIM_COLL)

KeyedBy

KeyedBy specifies the field used to identify a form instance

KeyOf

KeyOf returns the key of an item in a collection

Name

Name identifies the component Inherited from Object (PRIM_OBJT)

Owner

Owner owns this component Inherited from Object (PRIM_OBJT)

Parent

The component instance to which this instance is attached. The visual container for a control or the collector of a set of child instances Inherited from Object (PRIM_OBJT)

...

See also

All Component Classes

Technical Reference