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



Kurt,
You are correct.

Some of us were taught various techniques and logic to assist with the
readability and performance of the type coding that was around in RPG II and
III.

Dennis was referring to the technique of always testing to the positive
where possible.
I.e.
IF Rules Satisfied;
MYFLAG = *ON;
ELSE;
MYFLAG = *OFF;
ENDIF;

IF MYFLAG = *ON;
DO SOMETHING;
ELSE;
DO OTHERTHING;
ENDIF;

As opposed to:
IF MYFLAG <> *ON;
DO OTHERTHING;
ELSE;
DO SOMETHING;
ENDIF;


Norm Dennis

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Kurt Anderson
Sent: Friday, 15 January 2010 12:16 AM
To: 'RPG programming on the IBM i / System i'
Subject: Double Negative was RE: rpg style question

For the record, testing for "not equals" is not a double negative. That
would be something like "not not equals" (does that even compile?) The
phrase double negative implies redundancy, which David's "if" statement
doesn't have.

Personally, the way I structure my conditions is so the first true result is
expected to be the most common result of the condition.

-Kurt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Dennis Lovelady

IF MyFlag <> gYES;

My first comment is that double negatives (if something not equal yes then..
else..) drive me up a wall. Maybe it's just me, but at a minimum the cases
should be reversed. If = no then ... else ...

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.