COMMENT attribute

The COMMENT attribute defines a hint for the user about the form element.

Syntax

COMMENT = [%]"string"
  1. string is the text to display. With the % prefix, it is a localized string.

Usage

The most common use of the COMMENT attribute is to give information or instructions to the user.

The COMMENT attribute can be used for different types of form elements:
  • with form field definitions, to show a message when the field gets the focus.
  • with action views, to give a hint to the user about the action.

With form fields, this attribute is particularly appropriate when the field accepts only a limited set of values. The screen location where the message displays depends on external configuration. It can be displayed in the comment line, or in the status bar when using a graphical user interface. If the OPEN WINDOW statement specifies COMMENT LINE OFF, any output to the comment area is hidden even if the window displays a form that includes fields that include the COMMENT attribute.

The COMMENT attribute can, in specific situations, define a value placeholder message when the field is empty. If the COMMENT cannot be rendered in a dedicated area (as is the case with mobile devices), the COMMENT is used as the default PLACEHOLDER.

With actions, this attribute can be defined in the ACTION DEFAULTS section of a form or directly in an action view (BUTTON). See COMMENT action attribute for more details.

Example

-- In a form field definition
EDIT f1 = customer.name, COMMENT = "The customer name";

-- As action default
ACTION DEFAULTS
  ACTION print (COMMENT="Print current order information")
END

-- In a form button
BUTTON b1: print, COMMENT = "Print customer details";