Kbase P104071: How to know if a given CHARACTER field's actual data is larger than its data dictionary display form
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/05/2005 |
|
Status: Unverified
GOAL:
How to know if a given CHARACTER field's actual data is larger than its data dictionary display format?
FIX:
This code displays the CustNum, Country and length of the Country data for each Customer where the length of the Country field data exceeds its Data Dictionary define Display format:
DEFINE VARIABLE iDisplayLength AS INTEGER NO-UNDO.
FIND FIRST _File WHERE _File-Name = "Customer".
FIND FIRST _field OF _File WHERE _Field-Name = "Country".
ASSIGN
iDisplayLength = INTEGER (SUBSTRING ( _format, INDEX( _format, "(") + 1, INDEX( _format, ")") - INDEX( _format, "(") - 1)).
FOR EACH customer NO-LOCK:
IF LENGTH(Country) > iDisplayLength THEN
DISPLAY LENGTH(Country).
END.