14. VIFRED Form Components : Create Operation : Table Fields : Create Columns
 
Share this page                  
Create Columns
If you do not want to use the GetTableDef operation to create default columns for your table field, as explained in the previous discussion, you can create your own columns by entering an optional title and a mandatory internal name and display format for each column to be included in the table field.
The order in which you list columns in the Table Field frame is the order in which the columns appear across the form's table field from left to right when you are finished creating it. To change the order, see Change the Sequence of Columns (see page Change the Sequence of Columns).
You must enter values for the Column Internal Name and Display Format columns on the Table Field frame. Titles of columns are optional.
To create your own columns for the table field
1. If you want to enter an optional title, position the cursor at the first blank line in the Title of a Column section of the Table Field frame and type a title for the first column.
2. Use the Tab key to move the cursor to Column Internal Name. If you leave this column blank, VIFRED uses the column title you entered in step 1 as the internal name (excluding non‑legal characters). For more information on the distinction between the internal name and the field title, see Parts of a Form (see page Parts of a Form).
3. Press Tab to move the cursor to Display Format.
The display format controls how data is displayed or entered in the field. Specify the column display or input format by typing in the appropriate format code and optional parameters.
4. Press the Menu key when done.
If the field is to correspond to a data column in a table, the display format you specify must be appropriate for the data type and length declared for that column when the table was created. For more information on how display formats and data types are related, see Parts of a Form (see page Parts of a Form).
If the field is to be a data entry field, you can specify a data input template as 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 as it is entered, to see if it matches the template. If the user's entry does not match the template format, VIFRED disallows the entry, and the user must 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 (‑).