Kbase P91561: Why do I have extra spaces between the fields output with the DISPLAY statement?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  8/13/2004 |
|
Status: Unverified
GOAL:
Why do I have extra spaces between the fields output with the DISPLAY statement?
FACT(s) (Environment):
Windows
FACT(s) (Environment):
Progress 8.x
FACT(s) (Environment):
Progress 9.x
FACT(s) (Environment):
OpenEdge 10.x
FIX:
When we output some fields to the printer or to the terminal, extra spaces appear between the fields. For example, the code:
OUTPUT TO PRINTER.
FOR EACH customer NO-LOCK WHERE cust-num < 6:
DISPLAY
City FORMAT "X(7)" LABEL "City"
country FORMAT "X(15)" LABEL "Country".
END.
Would generate a report with 'extra spaces' appearing between the field values.
The reason for these 'extra spaces' is due to two factors:
1. The default font that Progress uses.
2. How Progress calculates the width of the field (or fill-in).
On Windows, if no font is specified, Progress uses two default fonts:
1. A fixed font for date fields, numeric fields, and for character fields that contain fill characters (such as the parentheses surrounding the area code of a telephone number.
2. A proportional font for character fields that do not contain fill characters.
Progress looks for definitions of these fonts in the current environment, which might be the registry or an initialization file. If the current environment does not define these fonts, Progress uses the system default fixed and proportional fonts.
By default the size of a fill-in on the screen is determined by its format and the font used when the code is compiled. For example, if a fill-in has a format of x(8) then 8 characters are visible on the screen. The external width of the fill-in might be 9 or 10 characters to allow for the side borders.
For proportional fonts on Windows, Progress considers the width of the widest character in the font (max-char-width) and the average width of all characters in the font (ave-char-width) to determine the width of a fill-in. Note that these rules differ for the default system font versus any other font.