×
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.
On 1/22/2013 10:43 AM, Buzz Fenner wrote:
To summarize (and to provide some background) I was faced with the following
coding style during a modification to some RPG III code:
C MOVEA'101' *IN,30
This has been used extensively in my shop for the last 30 years. I'm trying
to show the other guys the advantages of /Free but I wasn't able to do the
same thing with just a single line of code. Posting the problem to the forum
helped me a lot, and it also garnered the usual comments about bad coding
techniques. I'll give you that, but I'm in a bit of an ideological war here
and unless I can reproduce the same results using a single line of code,
I'll lose this battle. So much for background...
Presented without commentary in the hopes that it is self-explanatory.
d setIndicators...
d pr opdesc
d inString 99 const options(*varsize)
d startInd 10i 0 const
c/free
setIndicators('101': 30);
dump;
setIndicators('0101': 30);
dump;
setIndicators('1001': 32);
dump;
setIndicators('1001': 98);
dump;
*inlr = *on;
/end-free
p setIndicators...
p b
d setIndicators...
d pi opdesc
d ind 99 const options(*varsize)
d start 10i 0 const
dCEEDOD pr
d parmNum 10i 0 const
d descType 10i 0
d dataType 10i 0
d descInfo1 10i 0
d descInfo2 10i 0
d parmLen 10i 0
d ec 12a options(*omit)
d parmNum s 10i 0
d descType s 10i 0
d dataType s 10i 0
d descInfo1 s 10i 0
d descInfo2 s 10i 0
d parmLen s 10i 0
d ec s 12a
d i s 10i 0
d j s 10i 0
c/free
CEEDOD (1: descType: dataType: descinfo1: descinfo2: parmlen: *omit);
i = start;
if i > 99;
return;
endif;
for j = 1 to parmLen;
*in(i) = %subst(ind: j: 1);
i += 1;
if i > 99;
return;
endif;
endfor;
/end-free
p e
--buck
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.