Field options can be classified into three groups:
Each data field option has a #defined name that is used in the functions that set these options. The names of the options and a detailed description of each is given in Table 9.2. The options are defined in the header file vv_form.h.
Table 9.2: Data Field Options
| Option | Action When Option is ON |
| Field Display Options | |
| INITIALBLANKS | When the form is initially displayed or updated, blanks (spaces) are displayed in the field, regardless of the value of the data variable. Protected characters specified in the field picture will still be displayed in the field |
| LFTADJUST | Field contents are adjusted flush left upon field exit, if possible. If neither this option nor RTADJUST is ON, the field contents are not adjusted. If LFTADJUST is ON for a field, the field picture must be pure. (See Chapter 7, "Standard Data Field Types," for more information about pure field pictures.) |
| NOECHO | Entered characters are echoed to the screen with the "noecho" character (by default, '/0'). If the "noecho" character is not a printable character, nothing is echoed to the screen. This option is useful for defining password fields. |
| RTADJUST | Field contents are adjusted flush right upon field exit, if possible. If neither this option nor LFTADJUST is ON, the field contents are not adjusted. If RTADJUST is ON for a field, the field picture must be pure. (See Chapter 7, "Standard Data Field Types," for more information about pure field pictures.) |
| THSEPARATOR | (For numeric fields only.) The field is redisplayed with the thousands separator (by default, a comma) when leaving the field. If there is no room in the field to display the thousands separator, or if the field is being displayed in scientific notation, the thousands separator is not displayed. Upon entering the field, the thousands separator is removed when the first keystroke is entered. |
| BLANKONZERO | (For numeric fields only.) When the form is initially displayed or is updated, blanks (spaces) are displayed in a numeric field if the value of the underlying data variable is initialized to zero. |
| User Interface Options: | |
| CLEARONKEY | The field is cleared if the first keystroke entered in the field is a printable character. If the cursor keys are first used to position the cursor for a correction, the field will not be erased. |
| FILL | If the user starts entering characters in the field, the user must type a character in every position in the field. The user may choose not to enter anything in the field (see also the MUSTFILL and REQUIRED option). |
| FLDAUTOSELECT | If FLDAUTOSELECT is ON for the field and FLDCHSELECT is ON for the data form, then pressing Alt + the selection character for a field will move the user to the field and initiate an action ("press" the pushbutton, toggle the check box or Boolean toggle field). |
| INSERTINIT | Insert mode is automatically enabled when the user moves into the field. Normally, the user is put into Overstrike mode when the cursor moves to a new field. |
| MUSTFILL | All positions in the field must be filled before the user can exit the form. The user must enter something in this field. This option combines REQUIRED and FILL. |
| PROTECTED | The user can move into and out of the field but cannot change the field contents. Use this option to display data that you don't want altered. You can initially protect fields and later make them unprotected or vice versa, if desired. Set the SKIP option ON if you do not want the user to move into the field. |
| REQUIRED | The user must type at least one printable character in the field before moving to another field. If the REQUIRED option is set ON for a field, the SKIP option must be OFF for that field. |
| REQ_AT_EXIT | The user must type at least one printable character in the field before exiting the form. Setting REQ_AT_EXIT to ON allows the user to leave the field empty while filling in other data, but requires an entry before the user can exit the form. If REQ_AT_EXIT is set ON for a field, the SKIP option and the NOVAL_BLANK option must be OFF for that field. |
| RTENTRY | The physical cursor is locked in the right-most field position. As characters are entered, they are pushed to the left. |
| RTJUSTIFY | Combines RTENTRY, CLEARONKEY, and RTADJUST. |
| SKIP | The user is not able to move into the field. SKIP fields are not validated when the user leaves the form. If SKIP is set ON for a field, the REQUIRED and REQ_ON_EXIT options must both be OFF for that field. |
| Data Conversion Options: | |
| CHKTRUNCATE | During system field validation of decimal and floating point fields, the field entry is checked to see if truncation will occur during data conversion. |
| FORCECONVERT | After field validation and after the end-field function is called, the data typed in the field is converted and placed in the data variable. Conversion normally occurs when the user exits the form. |
| PICSKIP | For string, date, and time fields, the protected characters are deleted from the field string before it is converted and placed in the data variable. Upon initial display, the form editor inserts the protected characters in the display string obtained by converting the data variable |
| TRAILBLANKS | For string, date, and time fields, trailing blanks in the field are retained in the string placed in the data variable. This option is only in effect for string-based fields. |
| NOVAL_BLANK | Field validation (system and user) is not performed if the field contains only blank characters. If NOVAL_BLANK is set ON for a field, the REQ_AT_EXIT option must be OFF for that field. |
Setting Field Options for Individual Fields
Data Conversion with the PICSKIP Option
Using Thousands Separators in Numeric Fields
Preventing Truncation of Decimal and Floating Point Fields
Specifying the Character Used as a Decimal Separator
Creating Password Fields with the NOECHO Field Option