|
Hi Barbara, I ran across this piece of code today, and while I realize this isn't the "best" solution, it was pretty common in pre-RPGLE days: C MOVEA '0000' *IN(41) Set indic. In the days when a lot of indicators were required to do things with a display file, this was a common technique to turn off a range of indicators. It could also be used to both seton and setoff indicators within a range, e.g. C MOVEA '01010101' *IN(41) Set indic. which reduced two SETON/SETOF statements to a single line of source code. Thought you might be interested. Peter Dow Dow Software Services, Inc. 909 425-0194 voice 909 425-0196 fax ----- Original Message ----- From: <bmorris@ca.ibm.com> To: <RPG400-L@midrange.com> Sent: Wednesday, June 06, 2001 9:52 AM Subject: Re: MOVEA -> EVAL > > >Date: Tue, 5 Jun 2001 17:34:22 -0400 > >From: "Charlie Massoglia" <cmassoglia@voyager.net> > > > >Wouldn't the following be much easier to understand than using pointers > and > >still far more efficient than a MOVEA? > > > >d ds > >d xarr1 100 dim(10) > >d arr1 overlay(xarr1) > >d ds > >d xarr2 10 dim(100) > >d arr2 overlay(xarr2) > > > >c eval %subst(xarr2:1:%size(xarr1)) = xarr1 > >c eval xarr2 = xarr1 > > Charlie, if you intended the dim(10) to be on the arr fields rather than > the xarr fields, then yes, that would work, and may be easier to > understand. > But your code doesn't handle the array starting indexes. > C MOVEA arr1(n) arr2(m) > > It's probably not _any_ more efficient than MOVEA. MOVEA just sets > pointers, > calculates lengths, and copies in one fell swoop. (None of this applies > to MOVEA with numeric arrays - the compiler uses a loop for those, to > handle > conversions; you'd have to use a loop too (or possibly just EVAL directly, > depending on the number of elements and starting indexes.) > > But, I'm still waiting for someone to post an example where using MOVEA is > the best solution :) > > Barbara Morris > > +--- > | This is the RPG/400 Mailing List! > | To submit a new message, send your mail to RPG400-L@midrange.com. > | To subscribe to this list send email to RPG400-L-SUB@midrange.com. > | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: david@midrange.com > +--- _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.