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



Tommy - your solution uses multiplication - much more costly in terms of CPU cycles than the subtraction. Of course, Barbara Morris' solution is even neater - just put the minus sign in front of and expression.

Yes I know that the issue of cycles is not so bad anymore - nonetheless!

Vern

At 02:24 PM 1/22/2007, you wrote:

Not really the answer but...

Why w#ladj = *Zeros - dlsqty * dlstks;
Seems you want to make the resulting number a negative?

FWIW I would just do this:
W#ladj = (dlsqty * dlstks) * -1;



Thanks,
Tommy Holden


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jerry Adams
Sent: Monday, January 22, 2007 2:20 PM
To: RPG Midrange
Subject: *Zeros

Got a "strange" compile error message a few minutes ago:

RNF7421 30 1 Operands are not compatible with the type of operator.

The line in error read: w#ladj = *Zeros - dlsqty * dlstks;

When I changed *Zeros to simply 0, the program compiled without a
murmur.

So I pulled out the trusty (dusty) ILE RPG Reference manual. Page 126
says:

"*ZERO/*ZEROS Character/numeric fields: All zeros. The value is '0' or
X'F0'. For numeric float fields: The value is '0 E0'."

So I'm thinking (always dangerous), "Oh, *Zeros is a character field."

But, then, I remembered another line in this same program (and similar
lines in tons of other programs:

w#ladj = *Zeros;

I scanned some old, fixed-format code and found things like: *Zeros ADD
X Y.
Which means (to me, anyway) that *Zeros is a numeric field.

So, why did I get the compile error?

Thanks.
--
        * Jerry C. Adams
*IBM System i5/iSeries Programmer/Analyst
B&W Wholesale Distributors, Inc.* *
voice
        615.995.7024
fax
        615.995.1201
email
        jerry@xxxxxxxxxxxxxxx <mailto:jerry@xxxxxxxxxxxxxxx>


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


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