|
That is kinda freaky though....i got the same compile error, etc. seems that free format is a little finicky about *ZERO in this form. Using fixed format for the same code compiles fine: c eval w#ladj = 0-dlsqty*dlstks Maybe you found a bug... Thanks, Tommy Holden -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Holden Tommy Sent: Monday, January 22, 2007 2:25 PM To: RPG programming on the AS400 / iSeries Subject: RE: *Zeros 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.
As an Amazon Associate we earn from qualifying purchases.
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.