Kbase P10792: Negative sign is removed when typed before the digits and va
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  18/03/2003 |
|
Status: Unverified
FACT(s) (Environment):
Progress 9.X
SYMPTOM(s):
FORMAT manages the negative sign with "db" (debit), such as ">>>,>>>,>>9.99db"
Negative signs is removed when typed before the digits and value was 0
CAUSE:
Know problem. This format is not consistent with other formats such as ">>>,>>>,>>9.99-"
CAUSE:
Bug# 20021023-001
FIX:
Override the behavior by keeping track of previous value:
DEFINE VARIABLE d AS DECIMAL FORMAT ">>>,>>>,>>9.99db" INITIAL 0 NO-UNDO.
DEFINE VARIABLE e AS DECIMAL FORMAT ">>>,>>>,>>9.99-" INITIAL 0 NO-UNDO.
DEFINE VARIABLE WasNegative AS LOGICAL NO-UNDO.
DEFINE FRAME f d e.
ON 'VALUE-CHANGED':U OF d DO:
IF SELF:SCREEN-VALUE MATCHES "*db" THEN WasNegative = YES.
IF WasNegative AND LAST-EVENT:LABEL = "+" THEN WasNegative = NO.
IF WasNegative
AND LAST-EVENT:LABEL <> "-"
AND NOT SELF:SCREEN-VALUE MATCHES "*db"
THEN APPLY "-" TO SELF.
END.
UPDATE d e WITH FRAME f.