LABEL item type

The LABEL item type defines a simple text area to display a read-only value.

Rendering


LABEL item type screenshot

Figure 1. LABEL item type

Syntax 1: Defining a form field label

LABEL item-tag = field-name [ , attribute-list ] ;

Syntax 2: Defining a static label

LABEL item-tag: item-name [ , attribute-list ] ;
  1. item-tag is an identifier that defines the name of the item tag in the layout section.
  2. field-name identifies the name of the screen record field.
  3. item-name identifies the form element (name attribute in .42f) of a static label.
  4. attribute-list defines the aspect and behavior of the form item.

Attributes

COLOR, COLOR WHERE, COMMENT, FONTPITCH, HIDDEN, IMAGECOLUMN, JUSTIFY, REVERSE, SAMPLE, SIZEPOLICY, STYLE, TAG.

Form field label only: FORMAT, SAMPLE.

Static label only: TEXT.

Table column only: UNSORTABLE, UNSIZABLE, UNHIDABLE, UNMOVABLE, TITLE.

Usage

The LABEL form item type can be used to define a read-only text area as a form field or as a static label.

Some front-ends support different presentation options which can be controlled by a style attribute. You can for example change the text format to render HTML content.

Form field label:

This type of label item must be used to display values that change often during program execution, like database information. The text of the label is defined by the value of the corresponding form field. The text can be changed from the program by using the DISPLAY TO instruction to set the value of the field, or within a list by using a DISPLAY ARRAY. This kind of Form Item does not allow data entry; it is only used to display values.

Static label:

This type of label item must be used to display text that does not change often, like field descriptions. The text of the label is defined by the TEXT attribute; the item is not a form field. The text can be changed from the program by using the API provided to manipulate the user interface (see Dynamic User Interface for more details). It is not possible to change the text with a DISPLAY TO instruction. This kind of item is not affected by instructions such as CLEAR FORM. Static labels display only character text values, and therefore do not follow any justification rule as form field labels.

LABEL f001 = vehicle.description; -- This is a form field label 
LABEL lab1: label1, TEXT="Hello"; -- This is a static label