× 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.



Hi Rick,

No, our debate is between batching up a group of errors and passing
them back in a parameter or making the call back each time we
encounter an error. Using the call back will allow the caller to
terminate the edit routine on terminal errors but continue on warning
errors. Passing as parms requires all edits to be done before
returning.

I'm having a hard time envisioning a callback as a means of passing error messages.

IMHO, if your routine needs to be able to return multiple error messages, it's probably a good indication that your routine should be broken up into smaller pieces.

If you do have a good reason to return multiple messages at once, why not use program messages? (i.e. SNDPGMMSG or QMHSNDPM). Or a log file? Or an array?

I guess when I'm writing my logic, I want to make it as easy as possible to call. Requiring the caller to define a handler routine to be called back isn't all that bad by itself, but it does increase the complexity. Do you really want to introduce that requirement for every single subprocedure you write? (Because, invariably, they'll all need a way of passing messages).

Then, how is their callback routine going to communicate back with their mainline? Global variables? Now you create an encapsulation problem. Or are they to be passed back through parameters? If so, why bother with a callback?

There are certainly good reasons to use a callback -- but is error message handling a sufficiently complex scenario that it warrants it?

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.