|
From: "Buzz Fenner" <bfenner@xxxxxxxxxxxxxxxx>following
To: <rpg400-l@xxxxxxxxxxxx>,
Date: 01/22/2013 09:44 AM
Subject: Re: truncating a decimal value in /Free (Hijacked &
Solved...the hijacked that is)
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
To summarize (and to provide some background) I was faced with the
coding style during a modification to some RPG III code:trying
C MOVEA'101' *IN,30
This has been used extensively in my shop for the last 30 years. I'm
to show the other guys the advantages of /Free but I wasn't able to dothe
same thing with just a single line of code. Posting the problem to theforum
helped me a lot, and it also garnered the usual comments about badcoding
techniques. I'll give you that, but I'm in a bit of an ideological warhere
and unless I can reproduce the same results using a single line of code,following:
I'll lose this battle. So much for background...
Got pointed to a Jon Paris article (thanks!) and came up with the
to
D pIndicators s * inz(%addr(*in))
D indicators ds based(pIndicators)
D ind 1a overlay(indicators) dim(99)
In his original, the array elements were defined as 1n, but I changed it
what you see. The calc statement became this (since there's noequivalent to
MOVEA in free form):ran
C %subarr(ind:30:3) = '101';
The compiler balked when the array was defined as 1n, but accepted 1a. I
some test data and things looked OK, and I thought my problem wassolved,
until I tested more thoroughly.following:
In short folks, it didn't work. Debugging the statement shows the
someone
General Indicators:
... 30 '1' 31 '1' 32 '1' ...
Before the %subarr statement, they were all '0'.
So, I'm back to the drawing board but needed to inform the list so
else doesn't try the same thing!
Buzz
--
This is the RPG programming on the IBM i (AS/400 and 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 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.