Stefan
Well-Known Member
OpenEdge 10.2B04 GUI
A theoretically (based on the code) impossible entry outside range of list error was occurring in a static query on a temp-table. Since it was theoretically impossible I decided I would simply catch it, log it and analyze the results later. But then along came the fun...
At first I wanted to check which error message I would be getting so I used:
To my surprise this does not throw any error at all. So for sanity's sake:
Yes, error 560 is being raised and trapped. So updated the test a bit more to what it should be:
Hurrah, error 560 is back! But it is not caught (red cross error message) and message done is never reached. The query error is apparently raising a STOP and not an error:
Now error 560 is displayed as a red cross error message and message done is reached again...
So:
1. why is ENTRY( 0, cf ) > "" not raising an error when used in a query?
2. why is ENTRY( 0, tt.cf) > "" raising an uncatchable stop instead of a normal error?
A theoretically (based on the code) impossible entry outside range of list error was occurring in a static query on a temp-table. Since it was theoretically impossible I decided I would simply catch it, log it and analyze the results later. But then along came the fun...
At first I wanted to check which error message I would be getting so I used:
Code:
DEFINE TEMP-TABLE tt NO-UNDO FIELD cc AS CHAR.
DEF VAR cf AS CHAR INIT "ab".
CREATE tt. tt.cc = "aa".
DO ON ERROR UNDO, LEAVE:
FOR EACH tt
WHERE ENTRY( 0, cf ) > "" /* note that this is on the variable */
ON ERROR UNDO, THROW:
END.
CATCH oe AS PROGRESS.lang.syserror:
MESSAGE oe:getMessage(1) VIEW-AS ALERT-BOX.
END CATCH.
END.
MESSAGE "done" VIEW-AS ALERT-BOX.
To my surprise this does not throw any error at all. So for sanity's sake:
Code:
DEF VAR cf AS CHAR INIT "ab".
DO ON ERROR UNDO, LEAVE:
MESSAGE ENTRY( 0, cf ) > "" VIEW-AS ALERT-BOX.
CATCH oe AS PROGRESS.lang.syserror:
MESSAGE oe:getMessage(1) VIEW-AS ALERT-BOX.
END CATCH.
END.
MESSAGE "done" VIEW-AS ALERT-BOX.
Yes, error 560 is being raised and trapped. So updated the test a bit more to what it should be:
Code:
DEFINE TEMP-TABLE tt NO-UNDO FIELD cc AS CHAR.
DEF VAR ii AS INT .
DEF VAR cf AS CHAR INIT "ab".
CREATE tt. tt.cc = "aa".
CREATE tt. tt.cc = "bb".
DO ON ERROR UNDO, LEAVE:
FOR EACH tt
WHERE ENTRY( 0, tt.cc ) > "" /* note that this is on the temp-table field */
ON ERROR UNDO, THROW:
MESSAGE FILL( tt.cc, 20000 ) VIEW-AS ALERT-BOX.
CATCH oe1 AS PROGRESS.Lang.ERROR:
MESSAGE oe1:getMessage(1) VIEW-AS ALERT-BOX.
END CATCH.
END.
CATCH oe2 AS PROGRESS.lang.syserror:
MESSAGE oe2:getMessage(1) VIEW-AS ALERT-BOX.
END CATCH.
END.
MESSAGE "done" VIEW-AS ALERT-BOX.
Hurrah, error 560 is back! But it is not caught (red cross error message) and message done is never reached. The query error is apparently raising a STOP and not an error:
Code:
DEFINE TEMP-TABLE tt NO-UNDO FIELD cc AS CHAR.
DEF VAR ii AS INT .
DEF VAR cf AS CHAR INIT "ab".
CREATE tt. tt.cc = "aa".
CREATE tt. tt.cc = "bb".
DO ON STOP UNDO, LEAVE:
FOR EACH tt
WHERE ENTRY( 0, tt.cc ) > ""
ON ERROR UNDO, THROW:
MESSAGE FILL( tt.cc, 20000 ) VIEW-AS ALERT-BOX.
CATCH oe1 AS PROGRESS.Lang.ERROR:
MESSAGE oe1:getMessage(1) VIEW-AS ALERT-BOX.
END CATCH.
END.
CATCH oe2 AS PROGRESS.lang.syserror:
MESSAGE oe2:getMessage(1) VIEW-AS ALERT-BOX.
END CATCH.
END.
MESSAGE "done" VIEW-AS ALERT-BOX.
Now error 560 is displayed as a red cross error message and message done is reached again...
So:
1. why is ENTRY( 0, cf ) > "" not raising an error when used in a query?
2. why is ENTRY( 0, tt.cf) > "" raising an uncatchable stop instead of a normal error?