6 24 Data Classes

Visual LANSA

6.24 Data Classes

Data classes are components that define a value but are not visible. In most cases a data class corresponds to a repository field.

When you drag a field from the repository to a form, you create a visualization of the field. To try this out, drag the field  #SALARY  to a form. This definition is created for the field:

DEFINE_COM class(#SALARY.Visual) name(#SALARY) 

 

Note that the class here is #SALARY.Visual. The Visual class creates a component which displays a value and can accept user input. In the Details tab of the editor you can see all the properties of the Visual class. Many of them control the way the field is displayed.

Now, delete the Visual qualifier from the name of the class:

DEFINE_COM class(#SALARY) name(#SALARY) 

 

This changed statement now defines the data class component of #SALARY.  The field is no longer displayed on the form (because it is not visualized).The data class component simply describes a value, in other words the basic characteristics of the component: its data type, length, decimals etc.

Display the Details tab to see the properties of the #SALARY data class. Note that it has very few properties compared to the properties of the #SALARY.Visual class.

6.24.1 Using a Data Class

6.24.2 Data Classes as Variables

Ý 6. Creating Applications Using Components