Kbase P51516: The DISPLAY Statement can show truncated data if FORMAT is t
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  03/11/2003 |
|
Status: Unverified
SYMPTOM(s):
The DISPLAY Statement shows truncated character data
CAUSE:
The FORMAT of the field in its frame is smaller than the data to display.
The DISPLAY Statement always formats the data. The FORMAT is defined in the definition of the FRAME. If it is not defined explicitly in the definition of FRAME, then FRAME inherits from the defined FORMAT for the field in the schema (Data Dictionary).
FIX:
Here are few options to handle the situation:
1) Explicitly define a larger FORMAT in the DISPLAY Statement or in DEFINE FRAME Statement with:
DISPLAY MyTable.MyField FORMAT "X(70)".
2) Display the field with the VIEW-AS EDITOR option.
3) Use the Message Statement instead of the DISPLAY Statement.
4) Use the PUT Statement with the UNFORMATTED option instead of the DISPLAY Statement (when writing to a file, not valid for outputting to the screen).
5) Show that a datum has been truncated with something like:
DEFINE VARIABLE isTruncated AS LOGICAL NO-UNDO.
FOR EACH customer:
DISPLAY customer.custnum customer.comment FORMAT "X(30)"
WITH FRAME fDown 16 DOWN.
isTruncated = LENGTH(customer.comment) > LENGTH(customer.comment:SCREEN-VALUE).
DISPLAY isTruncated WITH FRAME fDown.
END.