8 3 1 BEGIN_COM Parameters

LANSA Technical

8.3.1 BEGIN_COM Parameters 

HELP

PUBLIC

PROTECT

PRIVATE

OPTIONS

DEFAULTPTY

ROLE

HELP

Use the HELP parameter to write a description for the component. It can be 250 characters long.

PUBLIC

Use the Public property of a form or a reusable part to make public a custom-defined event, method, or property of its ancestor which has been defined as protected in the ancestor.

A form or a reusable part can define that custom-defined events, methods and properties are not accessible from outside using the Protect property of the form or reusable part. Events, methods and properties defined as protected are visible to forms and reusable parts which inherit from it, but they are not visible to owner forms or reusable parts.

An inheriting form or a reusable part can make an inherited protected event, method or property visible to all other components by defining them as Public. The list of values for Public shows two internal system values CreateInstance and DestroyInstance. They should not be used.

The easiest way to set the Public parameter is to use display the Properties in the Details Tab. When you click on the Public property, a list of the protected events, methods and properties is displayed.

PROTECT

Use the Protect property to hide custom-defined events, properties or methods from owner reusable parts or forms. An event, method or property defined as protected is visible to inheriting reusable parts and forms. These can make the protected event, property or method visible to owners by defining it as Public.

The easiest way to set the Protect parameter is to display the Properties in the Details Tab. When you click on the Protect property, a list of the user-defined events, methods and properties is displayed.

PRIVATE

Use the Private property of a form or a reusable part to hide a custom-defined event, method or property from other forms or reusable parts. An event, method or property defined as Private is not visible to inheriting or owning reusable parts or forms.

The easiest way to set the Private parameter is to use display the Properties in the Details Tab. When you click on the Private property, a list of the user-defined events, methods and properties is displayed.

OPTIONS

Use the Options parameter to control how the component is inherited and instantiated.

*FINAL

The component class cannot be inherited further.

*ABSTRACT

The component class cannot be instantiated. You must inherit from this class and create instances of the descendent class.

 

DEFAULTPTY

The default property of this component.

This means that when you pass a reference to this component as *BY_VALUE parameter (in 8.6 DEFINE_MAP), it will automatically use the default property to get the value.

This is similar to using the default property of fields: Value. Whenever I refer to, for example, #SALARY in the code I am actually referring to #SALARY.VALUE since the .Value property is the SALARY classes default property.

ROLE

The Role parameter has a number of functions. 

*Extends

*Extends comes immediately prior to the ancestor class for the component.  In the example below, the component inherits from #Prim_FORM, the Visual LANSA primitive Form class.

Begin_Com Role(*EXTENDS #PRIM_FORM)

End_Com
 

*Extends corresponds directly to the ancestor property as seen in the property detailer and can be entered either in the details or directly in the source.

*Implements

*Implement is used to specify the interfaces that the component will implement. Unlike *Extends, which is limited to a single component, *Implements can have multiple arguments as shown below.

Begin_Com Role(*EXTENDS #PRIM_PANL *implements #Prim_dc.iMonitorSubject #Prim_dc.iContextualSubject)
 
End_Com
 

*ListFields

*ListFields applies when a reusable part is being used as the design element of a user defined control (UDC).  When ADD_ENTRY is used to create a list entry in a UDC, the fields or group of fields specified in the variables(s) following *ListFields are initialized with the values from the corresponding fields in the component that contains the ADD_ENTRY. 

Begin_Com Role(*EXTENDS *Implements #Prim_Tile.iTileDesign #PRIM_PANL *ListFields #ListFields)
 
Group_by Name(#ListFields) Fields(#Field #Field2 #Field3)
 
End_Com