× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Y'all

I must affirm Jon's remarks - MONITOR is just like try-catch that is prevalent in Java and C++ - it's used everywhere, the preferred error handling process there. Yes, I use it when I'm doing a conversion from character to decimal that could have non-numeric data - it is cleaner than a whistle. You are in complete control of how large a block you control with this technique - very cool!!

I guess I'd say my example is like what Ken said - an expected error - but we have those all over - just like using MONMSG - we expect certain things. Nonetheless, local reponse to unexpected errors is useful, too.

Vern

At 06:33 PM 11/10/2007, you wrote:


On 10-Nov-07, at 1:00 PM, Ken Sims wrote:

> IMO, monitor should be used sparingly, only for things that are
> unexpected or if there is no easy way provided to test in advance

Have to disagree with you here Ken.

Monitor is a relatively lightweight task and I feel the decision to
use/not use should be based on the likelihood of the error
occurring. The ease or otherwise of the testing is irrelevant.

Monitor logic is _much_ clearer since a) You know that the programmer
anticipated a potential problem b) the anticipated code path is
obvious c) the error handling is obvious.

When you see something like:

If myVar <> 0;
do lots of stuff:
else;
do other stuff;
endif;

You really don't know until much later _why_ the variable is being
tested - whereas an On-Error DivideByZero; makes it pretty darn clear.

I would agree with you in cases where there was a high probability
(i.e. > 50%) that the date was bad or whatever - but otherwise I
think MONITOR is a far superior solution.

Now if only Barbara would give us THROW to go with it ...



Jon Paris

www.Partner400.com
www.SystemiDeveloper.com


--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.