Kbase 13408: How to limit characters per line in editor widget (sample)
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
How to limit characters per line in editor widget (sample)
Users may want to restrict the actual number of characters that can be
entered on a single line in an editor widget for later printing. An
example would be shipping comments to be included on a pre-printed
form. The editor widget will calculate the display size based upon
the values supplied in INNER-CHARS and INNER-LINES, but will actually
allow as many characters as can be entered with the active font
during data entry. MAX-CHARS will limit the overall number of
characters, but again, doesn't address the maximum characters per
line issue. The font used for data entry must be a fixed-width font
used in combination with the other options to limit properly.
Example:
The following procedure limits data entry to 40 characters on each of
3 lines:
DEFINE VARIABLE x AS CHARACTER FORMAT "X(120)" VIEW-AS EDITOR
INNER-LINES 3 INNER-CHARS 40 MAX-CHARS 120 FONT 3.
UPDATE x.
In this example, font 3 is a fixed-width font (Courier New), but this
may vary from machine to machine. The user must supply a valid font
for their system.
Progress Software Technical Support Note # 13408