Progress
Internationalization Guide


The FORMAT Phrase

The Progress Data Dictionary Format field and the 4GL FORMAT phrase for character strings let you specify the display format in columns. For example, the character format “x(8)” can accommodate the following:

Fitting Multi-byte Characters Into the Available Columns

Before displaying or printing a multi-byte character, Progress ensures that the display or print field contains enough columns to accommodate the entire multi-byte character. If there are not enough columns, Progress does not display any of the multi-byte character, and pads the columns of the display field or print field with spaces.

NOTE: Progress neither splits nor truncates multi-byte characters to make them fit a display field.

For example, if you use the following format string, which specifies a seven-byte character field:

FORMAT "x(7)". 

to display the following character string, which consists of four double-byte characters:

Progress displays the first three double-byte characters in columns 1 through 6 of the field and a space in column 7, as shown below:

Progress does not display any of the fourth double-byte character, not even its lead byte, because doing so would split its lead byte from its trail byte, and the character would not appear properly.

Fitting Multi-byte Characters Around Formatting Characters

Before Progress displays a multi-byte character, if the next byte in the format specification is a formatting character, such as a dash, Progress inserts a space, then the dash, then searches the format specification for the next two available contiguous columns.

For example, if you use the following format, which consists of three bytes, a hyphen formatting character, and four bytes:

FORMAT "xxx-xxxx" 

to display the following string, which consists of four double-byte characters:

the result is the following string, which consists of the first double-byte character, a blank, the hyphen formatting symbol, the second double-byte character, and third double-byte character:

To build the resulting string, Progress:

  1. Displays the first double-byte character.
  2. Notices that only one column remains before the hyphen formatting character.
  3. Inserts a blank in that column.
  4. Displays the hyphen formatting character.
  5. Displays the second double-byte character.
  6. Displays the third double-byte character.
  7. Notices that no more space remains.
  8. Decides not to display the fourth double-byte character.
Allowing Single-byte Formatting Characters Only

Format strings cannot contain multi-byte characters. In the previous example, in the “xxx-xxxx“ format string, the x and the hyphen are single-byte characters. The following format string, which contains a double-byte character followed by two single-byte characters, is invalid:


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