× 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 Sharon,

I think you're forgetting that there's a compiler and some microcode between the RPG source code and the actual logic circuit.

And from what I recall of x86 processors, to do a compare, a couple of registers are loaded and a compare instruction is issued. The hardware set a bit indicating whether the registers were equal or not (implemented by doing a subtract). The compiler writer (hi Barbara!) would probably implement "not =" and "<>" the same way.

Btw, my Engineering 101 instructor once said that you could implement an entire machine with a subtract operation...

*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
pdow@xxxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxxx> /

On 3/1/2010 6:54 AM, Wintermute, Sharon wrote:
<> and NOT= are definitely NOT The same at the pure logical level.

Logic circuits don't work that way. By saying<> you are completing the
less than and the greater than test then making a decision based on both
results therefore making three tests.

Not = is only one test.



Sharon Wintermute
Sr. Software Engineer - Application Solutions
YRC Logistics
913.906.4309


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Dennis Lovelady
Sent: Monday, March 01, 2010 8:46 AM
To: 'RPG programming on the IBM i / System i'
Subject: RE: More on RPG style

In general I would agree with you. But, when you are performing
multiple tests
and as soon as you fail the first one, it is generally acceptable to
return immediately.
On this point, we will not agree, then. But before I go: generally
acceptable by whom? By you, or by your firm, or by some standards
organization?

Some clients prefer 'Not =' to '<>'.
Not equal is only one logical test where '<>' is two logical tests.
Besides it is much easier to debug 'not =' vs '<>' when the previous
pgmr
<> and NOT = are equivalents, and fall under the "not" rule (in my
opinion).

If you can write =, then why do you need<>?

If a = b ;
Something() ;
Else ;
somethingElse() ;
Endif;

Rather than:
If a<> b ;


Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
It's great to be smart 'cuz then you know stuff.




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.