Previous Next

CLEAR statement
Clears the data for all fill-in fields in a frame. It also clears the colors for all widgets in a frame, except for enabled fill-ins.
Note:
Syntax 
 
CLEAR [ FRAME frame ] [ ALL ] [ NO-PAUSE ]
FRAME frame
Represents the name of the frame containing the fill‑in fields you want to clear. If you do not name a frame, CLEAR clears the default frame for the block containing the CLEAR statement.
ALL
Clears all occurrences and resets the current display position to the top of the frame for a down frame (a frame used to display several occurrences of the fields in the frame).
NO-PAUSE
Does not pause before clearing the frame.
Example 
The r-clear.p procedure displays the ABL data types and their corresponding default formats. The procedure prompts you to enter values so you can see how ABL formats those values. If you answer YES, the AVM clears the values currently displayed so that you can enter new values.
 
DEFINE VARIABLE a AS CHARACTER NO-UNDO INITIAL "xxxxxxxx".
DEFINE VARIABLE b AS DATE      NO-UNDO INITIAL TODAY.
DEFINE VARIABLE c AS DECIMAL   NO-UNDO INITIAL "-12,345.67".
DEFINE VARIABLE d AS INTEGER   NO-UNDO INITIAL "-1,234,567".
DEFINE VARIABLE e AS LOGICAL   NO-UNDO INITIAL TRUE.
 
DISPLAY "This illustrates the default formats for the different data types"
  SKIP (2) WITH CENTERED ROW 4 NO-BOX FRAME head.
FORM "CHARACTER default format is ""x(8)"" " a SKIP
  "DATE default format is 99/99/99         " b SKIP
  "DECIMAL default format is ->>,>>9.99    " c SKIP
  "INTEGER default format is ->,>>>,>>9    " d SKIP
  "LOGICAL default format is yes/no        " e TO 55 SKIP
  WITH ROW 8 NO-BOX NO-LABELS CENTERED FRAME ex.
 
REPEAT:
  DISPLAY a b c d WITH FRAME ex.
  MESSAGE "Do you want to put in some values?"
  UPDATE e.
  IF e THEN DO:
    CLEAR FRAME ex NO-PAUSE.
    SET a b c d WITH FRAME ex.
  END.
  ELSE LEAVE.
END.
Notes 
*
*
*

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.