Kbase P183445: Error 148 without format string is raised unexpectedly when changing format of numerical column in b
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  3/14/2011 |
|
Status: Unverified
SYMPTOM(s):
Error 148 without format string is raised unexpectedly when changing format of numerical column in browse
** Numeric format provides for no digits. (148)
** Numeric format <format> provides for no digits. (148)
Browse widget has an enabled numerical column
Browse has a ROW-DISPLAY trigger that changes the format of this column at runtime
In the program's lifecycle there is never an invalid format string specified for the column, only valid formats are used
While a cell in the numerical column has focus, the browse's query is reopened in a way that returns no results (so the browse is emptied)
At a random point after these conditions are met, the error 148 will occur
Code similar to the following will trigger the issue:
DEFINE TEMP-TABLE ttOrderLine NO-UNDO
FIELD Itemnum AS INTEGER
FIELD ExtendedPrice AS DECIMAL FORMAT "->>>,>>9.99":U
FIELD Discount AS INTEGER
INDEX itemnum IS PRIMARY UNIQUE itemnum.
CREATE WIDGET-POOL.
DEFINE VARIABLE lFlip AS LOGICAL NO-UNDO.
DEFINE BUTTON BUTTON-1 NO-FOCUS FLAT-BUTTON
LABEL "Button 1"
SIZE 15 BY 1.14.
DEFINE QUERY BROWSE-2 FOR ttOrderLine SCROLLING.
DEFINE BROWSE BROWSE-2
QUERY BROWSE-2 NO-LOCK DISPLAY
ttOrderLine.Itemnum
ttOrderLine.ExtendedPrice FORMAT "->>>,>>9.99":U
ttOrderLine.Discount FORMAT ">>9%":U
ENABLE
ttOrderLine.ExtendedPrice
WITH NO-ASSIGN NO-ROW-MARKERS SEPARATORS SIZE 66 BY 6.43 FIT-LAST-COLUMN.
DEFINE FRAME DEFAULT-FRAME
BUTTON-1 AT ROW 2.19 COL 50 WIDGET-ID 4
BROWSE-2 AT ROW 7.9 COL 8 WIDGET-ID 200
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
SIDE-LABELS NO-UNDERLINE THREE-D
AT COL 1 ROW 1
SIZE 80 BY 16 WIDGET-ID 100.
ON ROW-DISPLAY OF BROWSE-2 IN FRAME DEFAULT-FRAME
DO:
MESSAGE "IN ROW-DISPLAY" VIEW-AS ALERT-BOX INFO BUTTONS OK.
ttOrderline.ExtendedPrice:FORMAT IN BROWSE browse-2 = "->>>,>>9.99":U .
END.
ON CHOOSE OF BUTTON-1 IN FRAME DEFAULT-FRAME
DO:
FIND FIRST ttOrderline.
IF lFlip THEN do:
OPEN QUERY BROWSE-2 FOR EACH ttOrderLine NO-LOCK
WHERE extendedprice > 0 INDEXED-REPOSITION.
lFlip = FALSE.
END.
ELSE DO:
OPEN QUERY BROWSE-2 FOR EACH ttOrderLine NO-LOCK
WHERE extendedprice < 0 INDEXED-REPOSITION.
lFlip = TRUE.
END.
/* WORKAROUND: make column read-only if there's no records being returned by query */
/* ttOrderline.ExtendedPrice:READ-ONLY IN BROWSE browse-2 = (QUERY browse-2:NUM-RESULTS = 0).*/
END.
ON CLOSE OF THIS-PROCEDURE RUN disable_UI.
PAUSE 0 BEFORE-HIDE.
MAIN-BLOCK:
DO ON ERROR UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK
ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK:
CREATE ttOrderline.
ASSIGN ttOrderline.Extendedprice = 5.
ENABLE BUTTON-1 BROWSE-2
WITH FRAME DEFAULT-FRAME .
OPEN QUERY BROWSE-2 FOR EACH ttOrderLine NO-LOCK
WHERE extendedprice > 0 INDEXED-REPOSITION.
IF NOT THIS-PROCEDURE:PERSISTENT THEN
WAIT-FOR CLOSE OF THIS-PROC.EDURE.
END.
.
FACT(s) (Environment):
Windows
OpenEdge 10.2x
CAUSE:
Bug# OE00205542
FIX:
Workaround:
Make sure the browse's enabled columns are read-only if the attached query returns no record. (See the commented lines in the sample above.)