Progress
Programming
Handbook
Character Formats
Table 17–2 shows some examples of how Progress displays a character value using different formats. Following the table is a description of the syntax.
The symbols used to construct character formats have the following definitions. In the definitions, the word digit means 0 through 9. The word letter means a–z, A–Z, and foreign alphabetic characters.
X
Represents any character.
N
Represents a digit or a letter. A blank (space) is not allowed.
A
Represents a letter. A blank is not allowed.
!
Represents a letter that is converted to uppercase during input. A blank is not allowed.
9
Represents a digit. A blank is not allowed.
(n)
A number that indicates how many times to repeat the previous format character. For example, !(5) is the same as !!!!! and represents five characters that are to be converted to uppercase when entered.
fillchar
You can use any character or characters you want to “fill” a display. For example, if you display the value abc with a format of x(3)***, the displayed value is abc***.
NOTE: To use X, N, A, !, or 9 as a fill character, you must precede that character with a tilde (~). To use a left parenthesis ( ( ) as a fill character after a nonfill character, you must precede it with a tilde. If you use these five characters as fill characters in a format specification in a procedure, then enter two tildes (~~) so that the Progress Procedure Editor interprets the tilde literally and not as an escape lead-in for the following character (for example, you specify a format of x999, where the x is a fill character, as FORMAT “~~x999").
The database does not store fill characters; Progress supplies them when it formats the field for display. This allows you to display a field with different fill characters in different contexts.Progress truncates the trailing blanks (spaces) in character fields. If a character field contains only one blank, the value is truncated to the null string. You can use the LEFT–TRIM, RIGHT–TRIM, or TRIM functions to truncate leading blanks, trailing blanks, or both.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |