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



On 8/25/2016 4:11 PM, John Yeung wrote:
On Thu, Aug 25, 2016 at 1:40 PM, Buck Calabro <kc2hiz@xxxxxxxxx> wrote:
On 8/25/2016 12:46 PM, John Yeung wrote:
I mean, the extra step is not a crime. It's not even expensive. But I
don't really see what it gains, and I hate to encourage unnecessary
code.

I can't believe I forgot another, important, reason that my API pattern
is to use variables: Debugging.

dcl-c coolAPI_ADD const('A');
dcl-c coolAPI_DEL const('D');

coolAPI(coolAPI_ADD: data);

When RPGUnit locates this section of code as the failing bit and I throw
it in debug to observe the behaviour, I can see that I should have
specified the constant as an R, not a D [1]. If I'd used a variable, I
could change it before the call and make sure the rest of logic works. [2]

[1] Yes, I know the constants should be defined in the same /copy as the
prototype. I needed a simple example (how meta!) to describe the scenario.

[2] Yes, I know I could change the value inside the called
sub-procedure. Unless it's someone else' ssub-procedure and I can't
debug 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.