PROGRESSBAR item type

Defines a progress indicator field.

PROGRESSBAR item basics

The PROGRESSBAR form item defines a field that shows a progress indicator.

Note: Use a SMALLINT or INTEGER variable with a PROGRESSBAR form item. Larger types like BIGINT or DECIMAL are not supported.

Defining a PROGRESSBAR

The VALUEMIN and VALUEMAX attributes define respectively the lower and upper integer limit of the progress information. Any value outside this range will not be displayed. Default values are VALUEMIN=0 and VALUEMAX=100.

Front-ends support different presentation and behavior options, which can be controlled by a STYLE attribute. For more details, see Common style attributes and ProgressBar style attributes.

Displaying PROGRESSBAR values

The position of the progress bar indicator is defined by the value of the corresponding form field. The value can be changed by the program using the DISPLAY TO instruction, to set the value of the field, or by changing the program variable bound to the field when using the UNBUFFERRED dialog mode.

Progress information is typically displayed during non-interactive program code. To show changes to the end user in this context, you need to use the ui.Interface.refresh() method to force a refresh. To provide the best feedback to the user, consider calling the refresh() method regularly but not too often, otherwise you will overload the network traffic and bring down the front-end component.

For example, if you have to process 1000 rows, define VALUEMIN=0 and VALUEMAX=1000 in the PROGRESSBAR item, and perform a refresh every 50 rows:
FOR row=1 TO 1000
    ...
    IF (row MOD 50) == 0 THEN
       LET myprogbar = row
       CALL ui.Interface.refresh()
    END IF
END FOR

Where to use a PROGRESSBAR

A PROGRESSBAR form item can be defined in two different ways:
  1. With an item tag and a PROGRESSBAR item definition in a grid-layout container (GRID, SCROLLGRID and TABLE).
  2. As a PROGRESSBAR stack item in a STACK container.