Consultor Eletrônico



Kbase 15603: How UNDO processing occurs with RETURN ERROR
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
How UNDO processing occurs with RETURN ERROR

This knowledgebase entry describes the UNDO processing that occurs
when the ERROR option is used on the RETURN statement.

Consider the example where pgm1 RUNs pgm2 which then executes RETURN
ERROR. If the RUN statement does not have the NO-ERROR option then
the error condition is raised on the block in which the RUN is
executed and all work that is in a transaction from the beginning of
the iteration of that block is undone. If the RUN statement has the
NO-ERROR option then the error condition is raised on the RUN and
all work, that is in a transaction, from the beginning to the end
of the RUN is undone.

Also, record connects (for example, FINDing a record into a buffer)
are undone regardless of whether or not they are in a transaction.

This behavior is sometimes perceived as a bug. For example, if pgm2
FINDs a record and then displays a message as to whether or not the
record is available, it will be available. If then, however, RETURN
ERROR is executed and, back in pgm1 another messgae is displayed as
to whether or not the record is still available, it will no longer
be available. This is because the RETURN ERROR effectively clears
the record buffer (or disconnects the record from the buffer). This
is expected behavior, and Progress is not likely to consider changing
it. This behavior is critical to the model on which the 4GL is based,
and much of the language depends on it.

Progress Software Technical Support Note # 15603