Defining the FIELD section
The )FIELD section of a panel definition specifies what fields, if any, are scrollable fields. Defining a field as scrollable provides the ability to display and input a variable larger than the display area that the dialog variable occupies. The LEFT, RIGHT, and ZEXPAND primary commands are active when the cursor is positioned within the variable on the display panel. These enable left and right scrolling and expansion of the variable into a pop-up window.
- Each entry in the )FIELD section must begin with the keyword FIELD.
- With the exception of the LCOL parameter, all dialog variable names must be unique to each parameter.
- Scrollable field support is panel specific. A subsequent panel display that references the same variable but does not define it as scrollable may cause data truncation (depending on the data lengths involved).
The command field for a panel has a maximum length of 255 characters. The LEFT and
RIGHT commands cannot be used to scroll data in the command field.
where:
- FIELD(field-name)
- The name of the field on the panel that this statement controls.
- LEN(value|field-name)
- Length
of the displayed variable.
value: Specify a value between 1 and 32 767.
field-name: The length dialog variable can be used to specify an initial length if it contains a value between 1 and 32 767. After the display, this variable will contain the calculated display length.
Calculated display length: The length of the variable will be the maximum value of the default display variable length and the specified length.
Default: If the LEN parameter is not specified, the field will default to the length of the dialog variable, if it exists. For variables referenced in a )MODEL section, the dialog variable length will be the maximum of all instances on the current display for that variable.
- IND(field-name,value)
- Left
and right scroll indicator dialog variable.
field-name: This must refer to a 2 byte scroll indicator dialog variable that will be updated on the panel to indicate whether left and right scrolling can be performed.
value: (Default -+) Specify a 2 byte literal (enclosed in quotes) to override the default scroll indicator values. Each byte must be nonblank.
Displays as:- -+
- Indicates that you can scroll left and right
- -
- Indicates that you can only scroll left
- +
- Indicates that you can only scroll right.
Panel definition:
)ATTR | TYPE(OUTPUT) CAPS(OFF) JUST(ASIS ) _ TYPE(INPUT) CAPS(OFF) JUST(ASIS ) )BODY +Scrollable Variable:_SCRFLD |SCRIND+ )FIELD FIELD(SCRFLD) IND(SCRIND,'<>') /* replace -+ with <> */Panel display:
Scrollable Variable: CDEFGHIJKLMNOPQRST <> - LIND(field-name,value)
- Left
scroll indicator dialog variable.
field-name: This must refer to a 1 byte left scroll indicator dialog variable that will be updated on the panel to indicate whether left scrolling can be performed.
value: (Default -) Specify a 1 byte nonblank literal (enclosed in quotes) to override the default left indicator value.
Displays as:- value
- Indicates that you can scroll left
- blank
- Indicates you are positioned at the start of the field.
Panel definition:
)FIELD FIELD(SCRFLD) LIND(LSCRIND,'<') /* replace - with < */ - RIND(field-name,value)
- Right
scroll indicator dialog variable.
field-name: This must refer to a 1 byte right scroll indicator dialog variable that will be updated on the panel to indicate whether right scrolling can be performed.
value: (Default +) Specify a 1 byte nonblank literal (enclosed in quotes) to override the default right indicator value.
Displays as:- value
- Indicates that you can scroll right
- blank
- Indicates you are positioned at the end of the field.
Panel definition:
)FIELD FIELD(SCRFLD) RIND(RSCRIND,'>') /* replace - with > */ - SIND(field-name,value)
- Separator
scroll indicator dialog variable. This field will be initialized with
the value repeated for the length of the field on the panel. If the
field is scrollable to the left, the leftmost byte will be the value
of the left indicator (default '-'). If the field is right scrollable,
the rightmost byte will be the value of the right indicator (default
'+').
field-name: This must refer to a 3 byte scroll indicator dialog variable that will be updated on the panel to indicate whether left and right scrolling can be performed.
value: (Default '<->') Specify a 3 byte literal (enclosed in quotes) to override the default separator indicator values. The 3 bytes represent the left scroll indicator, the separator value and the right scroll indicator respectively. Each byte must be nonblank.
Panel definition:
)ATTR | TYPE(OUTPUT) CAPS(OFF) JUST(ASIS ) _ TYPE(INPUT) CAPS(OFF) JUST(ASIS ) )BODY +Separator Variable:|SEPIND | +Scrollable Variable:_SCRFLD | )FIELD FIELD(SCRFLD) SIND(SEPIND)Panel display:
Separator Variable: <----------------> Scrollable Variable: CDEFGHIJKLMNOPQRST - LCOL(field-name)
- Left
column dialog variable - to display current left position.
field_name: This must refer to a dialog variable that will be updated when the field is scrolled to contain the left column value. You can use this to specify an initial left column position for the scrollable field. It must be a numeric value greater than or equal to 1. Values greater than the maximum left column position will be set to the maximum left column position.
Note: Fields with the same left column dialog variable will scroll simultaneously and will have the same left column value up to the maximum for each field. - RCOL(field-name)
- Right
column dialog variable - to display current right position.
field_name: This must refer to a dialog variable that will be updated when the field is scrolled to contain the right column value. It is an output field only. Any pre-existing values will be ignored and will be replaced with the current right column value.
- SCALE(field-name)
- Scale
indicator dialog variable. This field will be initialized with a scale
line reflecting the current columns within the field being displayed.
The variable will occupy the display length on the panel with the
a value as follows:
----+----1----+----2----+----3... etc.field_name: This must refer to the dialog variable that is placed on the panel in the position at which the scale line is to be initialized.
Panel definition:
)ATTR | TYPE(OUTPUT) CAPS(OFF) JUST(ASIS ) _ TYPE(INPUT) CAPS(OFF) JUST(ASIS ) )BODY +Scale Line :|SCLIND | +Scrollable Variable:_SCRFLD | )FIELD FIELD(SCRFLD) SCALE(SCLIND)Panel display:
Scale Line : --+----1----+----2 Scrollable Variable: CDEFGHIJKLMNOPQRST - SCROLL(value|field-name)
- Scroll
control field.
- value:
-
- OFF
- Field is not scrollable
- ON
- Field is scrollable
- field_name:
- Specifies a scroll control dialog variable which you can set to a value of OFF to turn scrolling off from the application or from the panel.
- NOLR:
- LEFT/RIGHT scrolling is disabled for the scrollable field.
Default: If the SCROLL parameter is not specified, the default for the scroll control is ON.
