5.8 Field Description Fields

The fields on the Field Description Screen 1 of 2 are covered in the following paragraphs.

gifs/00000001.gif

The Field Name field names the field that you are adding or updating. If the In Data File field is set to yes, the name entered here must be one of the data fields in the RMSfile specified on the Form Description screen. If formdef cannot find the data field in the RMS dictionary file, an error message is given.

The Field Length field specifies how long the screen field should be in characters. The field length should be large enough to display the values in the RMSfile. If the field in the RMSfile is a character string, the screen field must be at least one character shorter than the data field. This allows form to insert a string terminator into the data field in the RMSfile. If the Field Length field is empty when you enter the field name, formdef fills the Field Length field with a length appropriate for the field named. For string data fields, this is one less than the length of the data field. For other fields, the field length chosen is long enough to represent the data in the RMSfile.

Note that this field length is unrelated to the field length you specified when you created the RMSfile. When you create a RMSfile, the field length specifies how much storage to reserve to store the internal representation of the data in the RMSfile. In formdef, the field length specifies how long the field is on the screen. It takes two bytes to store an integer in the RMSfile, but it can take up to six positions on the screen to display an integer.

The next two lines on the Field Description form specify the field type.

If the Entry Allowed field is set to yes, then the field is an entry field. In an entry field, the operator can enter or change data displayed in this screen field. Only entry fields are displayed in reverse video, so that they are obvious to the operator. If the Entry Allowed field is set to no, no data may be entered into the field. This field is called a display field. Display fields are used to display data fields in the current or other RMSfiles whose contents cannot be changed by the user. Display fields are usually shown as underlined fields to distinguish them from entry fields. This emphasizes to the user that the field value cannot be changed.

If the In Data File field is set to yes, data entered into this screen field is stored into the data field when a record is stored. When a data record is displayed, the contents of the data field in the RMSfile is displayed in the screen field. If the In Data File field is set to no, the field on the screen is not in the RMSfile. It may be a field used to display data from another RMSfile, or it may be a field used for data entry (if Entry Allowed is yes) but the data is not stored in the RMSfile.

If the Input Required field is yes, form requires that the field contain data when the record is stored. It is possible to skip over the field and enter data in fields appearing on the screen after the required input field, but when the record is stored, all input required fields must contain data. The rule used by form is that all input required fields must be nonblank. A numeric field with input required may have only the digit 0 entered to fulfill the input required rule, but it could not be left as all blanks. If the numeric field did not have required input, either of these two formats could be used to enter a zero value.

When the Invisible field is set to yes, the field is not visible when the form is used for data entry. Use of invisible fields is explained in a later section.

When you add a data field description, the Entry Allowed, In Data File, Input Required, and Invisible fields can all be left blank. If they are still blank when the field description is stored, the Entry Allowed and In Data File fields are set to yes; the Invisible and Input Required fields are set to no.

The fields described above are the ones used most often when creating data entry forms. The next section provides an example of their use.