14. VIFRED Form Components : Create Operation : Creation of Simple Fields : Create Data Windows and Display Formats
 
Share this page                  
Create Data Windows and Display Formats
The data window is the part of the field where data is displayed or entered. For a more detailed explanation, see Parts of a Form (see page Parts of a Form).
To create a data window when creating a new field
1. Position the cursor at the point on the form in the Form Layout frame where you want the new window to be.
2. Choose the DisplayFormat operation on the Create Field submenu.
VIFRED displays the message:
Enter format (press <MENU KEY> when done)
3. Enter a display or input format.
For example, type in c10 to create a character field that can display a maximum of 10 characters, or type in a format template. For more information, see the discussion following this procedure.
4. Press the Menu key when done.
If the field is to correspond to a data column in a table, make sure that the data window display format you specify is appropriate for the data type and length declared for that column when the table was created.
Note:  You cannot create a field with a display format that can display data from a column of long varchar, byte, byte varying, and long byte data types.
If the field is to be a data entry field, you can specify a data input template for the display format. The data input template indicates to the user how the data must be entered and causes VIFRED to check the input, character by character, to see if it matches the template. If the user's entry does not match the template format, VIFRED disallows the entry, and requires the user to either re‑enter the character in that position or re‑enter the data from the beginning of the field, depending on the particular input template. For more information, see Input Masking in Data Entry Fields (see page Input Masking in Data Entry Fields).
The following table gives some simple examples of data display and input formats. Keep in mind that some of the display format symbols are the same as data type symbols, yet they perform different functions.
Display
Description
i8
Numeric data, whole numbers only. Up to 8 digits can be entered or displayed.
f10.2
Numeric data with decimal numbers. Field can display 10 characters including the decimal point, with two places shown to the right of the decimal point.
c10
Character data. Field is 10 characters wide.
s'aa\‑zzzzzz'
Data input template for a part number, where a indicates an alphabetic character, z represents a numeric character, and \‑ is a dereferenced hyphen (‑).