Progress Programming Tips

By Rod Gaither (rdg@worldinfo.com)


PPT-19  Emulating exceptions in Progress - Part 3 of 3

Tip:

[Info - Source in attachments]

As a conclusion to the exceptions tip here are some sample
routines that show standardized error handling includes in
action.  The example is not elaborate, or very real world, but
serves to display the techniques.

As with any topic once I sat down to write the code I learned
several things I didn't know before hand and came away with
some new questions (Later PPT's perhaps :-)).

My first attempt had the button triggers calling an internal
procedure for each type of error.  What I discovered is that
RETURN ERROR from an internal procedure to a user interface
trigger doesn't seem to do anything.  I haven't checked this
out yet but it seems strange that the main block doesn't end up
with an error condition.

I also found it difficult to determine the best way to both
trap the error condition and then raise it again to get default
behaviour for external blocks.  You can RETURN ERROR in an
internal procedure if the check was a whole procedure level
operation.  You can apply an UNDO when in a simple block
situation.  The manual also mentions the possibility of
applying the "ERROR" event, but to what?  All of these options
are complicated by wanting a single err.i and not being able to
determine the context or placement of the include file reference.

Still a lot of room for learning I guess.  :-)

The sample source is v8 windows with no DB required.

Wisdom:

Every day presents some opportunity for learning, don't get so
busy with the routine that you miss the chance to improve
yourself.


Rod Gaither                  | rdg@worldinfo.com
World Information Systems    | (910) 333-2580  Voice
Greensboro, NC               | (910) 333-2584  Fax