Control Attributes

From BR Wiki
Jump to navigation Jump to search

Control attributes modify the operation of the screen. They have meaning only with INPUT FIELDS and RINPUT FIELDS statements; PRINT FIELDS ignores them. The following control attributes may be specified:

A Automatic advance to the next field after data entry to the last position in this field in multiple field processing.
C Cursor is to be placed in this input field first. C is used only when multiple input fields are coded from the same statement. When C is not specified, the cursor is positioned at the first field in the field specification array. If C is specified for more than one field, the cursor is positioned in the last field of the array containing the C attribute.
E Automatic enter when data is entered or changed in a field and the FIELDPLUS (Ctrl-U) key is pressed or the field is exited. (The only keys that will not cause an automatic enter after data has been entered or changed are the arrow keys.)
' This feature is useful for Verifying codes stored in a related file. For example, if vendor number changes, display the new company name; if vendor number does not change, do not bother to read the vendor file.
G Automatic enter of screen when entering this field (does not await key entry). This feature directs the system to read the screen without operator response.
L The field attribute L pertains to only the first and last field of a FIELDS array. It works like X (auto enter) if and only if the cursor is moved out of the array. That is, L has no effect unless the up arrow is pressed while in the first field, or the down arrow is pressed while in the last field, in which case it returns control to the program with an Fkey Value of 102, 103, or 104 (up-arrow, left-arrow, or down-arrow).
This is used only for first and last fields on an input select statements and allows you to scroll up and down out of the array.
P Protected field. This feature causes the cursor to skip over the field (no input is allowed). Possible uses for this attribute include protecting the key field in an update program, allowing only certain users to edit certain fields for security reasons, and setting up automatic field skipping for fields that operators choose to never use (tax code, for instance). Error code 0866 will result if all fields are protected fields.
Q This will make a field become a "Hot Text Field" , it is followed by a parameter that defines what value will be returned when activated. Even linedraw characters can be "hot".
S Creates a sunken field effect. Not active in 4.17 in the GUI mode. In PRINT mode in 4.17 this will create a blue line around a white background. In input or rinput mode this will have no effect.
T Tab key moves cursor to next T field.
X This will cause the "Enter Key" to be pressed when you exit the field. Special control attributes exist for field processing. "E" emulates the pressing of Enter when a field is exited with the Field Plus or Field Minus key. The two control attributes "AE" can be combined to create an Enter when the last position of a field is filled. This combination, however, will not create an enter if the field is exited with an arrow or mouse click.
The control attribute X has been added for error processing in FIELDS and SELECT statements. X causes FIELDS statements to quit processing whenever the field with an X is exited. The difference between X and AE is that X will simulate an enter no matter what key is used to exit the field, whereas AE will not simulate the enter if the operator simply arrows up or down through the field without changing data.
The X control attribute has the affect of turning the INPUT FIELDS instruction into a single-field input operation (all other fields are effectively ignored for operator input). It is especially useful when used with CURFLD to reject invalid data from an input field. The operator must respond with correct data before any other information can be entered. See the example in the CURFLD function discussion for more information.
# The # symbol represents an actual number which is coded as an attribute that identifies the starting cursor position within a field.


The following example shows how the cursor can be positioned on the third character of a date field. Since only the middle field of a date (mmddyy format) is typically changed, this feature saves time for the operator.

01100 RINPUT FIELDS "10,40,n 6,u3": SHIPDATE

In the following example, an entire 24 by 80 screen is treated as one field and the cursor is positioned at location 1841, which is column 1 of row 24:

01100 RINPUT FIELDS "1,1C 1920,R1841": A$