Progress
Language Tutorial
for Character
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.
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:
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.
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 |