Kbase 13920: How GO-ON and WAIT-FOR are related to error handling
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
How GO-ON and WAIT-FOR are related to error handling
How GO-ON list affects Default Error Processing in 7.2 and 7.3
--------------------------------------------------------------
In version 7.2 if you had END-ERROR in a GO-ON list and
then during an update you hit the END-ERROR key, you would
still get END-ERROR processing. THis was a bug in 7.2D. If
you have END-ERROR in a GO-ON list then pressing END-ERROR
key should simply break the update and allow you to go on
(it should not cause END-ERROR default processing). This is
the point of the GO-ON list. Take a look at the following
example:
DEFINE VARIABLE x AS CHARACTER.
UPDATE x GO-ON (F4 PF4 ESC).
MESSAGE KEYFUNCTION(LASTKEY).
In version 7.2D the above example would produce the
incorrect behavior due to the GO-ON bug. In other words,
when the END-ERROR key is pressed default END-ERROR
processing would occur and the message statement would not
get executed. In version 6 (where it always worked
correctly) and version 7.3 (where the bug was fixed),
pressing the END-ERROR key 'breaks' the update and goes on
to the next statement (in this case, the message
statement). This bug may not always be so easy to detect
however since it may appear in code that does not use the
obvious UPDATE and GO-ON statements. For example, take a
look at the following code:
define variable mticket as char label "ticket".
define button a-delete label "delete" size 8 by 1 auto-go.
define button a-undo label "undo" size 8 by 1 auto-endkey.
define frame upd-frm
a-delete at row 1.55 col 4
a-undo at row 1.55 col 14
with row 5 width 50 centered side-labels overlay
no-box.
form skip (0.1)
mticket colon 25 label "ticket"
with frame a no-box side-labels overlay row 1.5
centered.
mainloop:
repeat on endkey undo, leave mainloop:
enable a-undo with frame upd-frm.
update mticket with frame a.
loop1:
repeat on endkey undo, leave mainloop:
do on endkey undo, next mainloop:
enable all with frame upd-frm.
wait-for choose of a-delete, a-undo.
end.
end.
end.
hide frame a.
This code when run in 7.2D will exhibit the incorrect
behavior due to the GO-ON bug. If you press enter to get out
of the update in mainloop and then press the a-undo button
(auto-endkey properties) then it will exhibit
end-error default processing EVEN THOUGH the a-undo
(end-error) button is in the GO-ON (wait-for) list. The
default error processing will occur and the program
will undo and leave you back up in the update statement
(part of the main loop).
In version 7.3, the GO-ON bug has been fixed and this same
code, when the a-undo key is pressed, will simply 'break'
the wait-for and allow the user to go on to the next
statement. This means it goes up to the next iteration of
the loop1 and continues. If you want the default end-error
processing here it is important to TAKE THE END-ERROR OUT OF
THE GO-ON LIST (this means, in this example, to take the
a-undo key out of the wait-for).
Progress Software Technical Support Note # 13920