Progress
Language Tutorial
for Windows


Field Formats

The format of a field describes the way that Progress displays data on your screen and in printed reports. The format is a string made up of literals and symbols. Literals are extra characters that you want to display with data and symbols are place holders for data. When you create a field in the Data Dictionary, Progress supplies a default format string for the particular data type. If that format string doesn’t suit your needs, then you can specify another.

To create format strings, you first need to understand the format symbols. Table 4–7 describes these symbols.

Table 4–7: Field Format Symbols 
Symbol
Description
X
Represents an alphanumeric character position.
A
Represents a letter position. A blank, digit, or punctuation mark is not allowed.
N
Represents a letter or number position. A blank is not allowed.
!
Represents a letter (A) that must be displayed in uppercase. A blank is not allowed.
9
Represents a numeric character position. A blank is not allowed.
-
Places a minus sign in front of numeric data if the value is negative or a blank if the value is positive.
>
Designates zero suppression. That is, Progress replaces > with a number, as long as it’s not a leading zero. If it’s a leading zero, Progress replaces > with a blank.
,
Displays a comma, unless a > precedes it and the character is a leading zero. If the character is a leading zero, Progress replaces the comma with a null.
.
Represents a decimal point.

To create a format string, just put together the symbols to describe how to display the data. For example, if a character field contains the word “Wonderful”, one format string could be “AAAAAAAAA”. If you want the data to display in uppercase, change the format string to “!!!!!!!!!”. If the field can contain numbers too, change the format string to “NNNNNNNNN”. If the field can contain any number, letter, or character, including blanks, then use the format string, “XXXXXXXXX”.

Instead of typing long strings of symbols, you can use this shortcut:

  1. Specify the symbol.
  2. Indicate the number of total places enclosed in parentheses.

So, “XXXXXXXXX” becomes “X(9)”.

Using “X(9)” displays “Wonderful”. If you specify “X(6)”, only “Wonder” displays. Specifying “X(3)” displays “Won”. Note that even though the last two format strings truncate the value on the screen, they do not affect the actual data stored in the field or limit the storage capacity of the field. Format strings affect displays only.

To see more examples of legal format strings for a particular data type, open a field property sheet and choose the Examples button next to the Format property. For the Cust-Num field, whose data type is integer, choosing the Examples button displays the information shown in Figure 4–11.

Figure 4–11: Format Examples Dialog Box

While the format strings help display existing data, they also limit user input. For example, if a field has a format string that converts all data to uppercase, then when the user enters data, it will be converted to uppercase. Similarly, a format string that specifies numeric data prevents a user from entering letters and special characters into the field.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095