|
Tommy's right, as usual. And the Overlay() technique is the one I use, too.I did, however, want to point out that one usually wants to use the MOVEA (not the MOVE) op-code when dealing with arrays. Details too lengthy to go into here so check either the RPG reference manual or Cozzi's book.
* Jerry C. Adams *iSeries Programmer/Analyst B&W Wholesale Distributors, Inc.* * voice 615.995.7024 fax 615.995.1201 email jerry@xxxxxxxxxxxxxxx <mailto:jerry@xxxxxxxxxxxxxxx> Holden Tommy wrote:
Does your DS look like this??D DS D ARC 10aD ARD 1a DIM(10) Overlay(ARC)If so then anything you move into ARC should automagically populate the array. Likewise if you load the array it should automagically load the char field. Thanks, Tommy Holden -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of steema@xxxxxxxxxxxxx Sent: Monday, January 30, 2006 10:44 AM To: RPG programming on the AS400 / iSeries Subject: **SPAM** RE: updating a PF from an array Thanks Tommy, does it work the other way? I noticed that a plain MOVE does not actually do it, MOVE J8CMNT ARC the array stays blank after this statement.Generally when I have to do this I use the D specs...it's easier &moreefficient (IMO)... D DS D Alpha 10a D ARD 1a DIM(10) Overlay(Alpha) Now the array can be referenced via array element or as a 10 byte char field. Not to mention you no longer have to "move" the array data. Both fields point to the same block of memory. Thanks, Tommy Holden -----Original Message----- From: rpg400-l-bounces+tommy.holden=hcahealthcare.com@xxxxxxxxxxxx [mailto:rpg400-l-bounces+tommy.holden=hcahealthcare.com@xxxxxxxxxxxx]OnBehalf Of steema@xxxxxxxxxxxxx Sent: Monday, January 30, 2006 10:01 AM To: RPG programming on the AS400 / iSeries Subject: updating a PF from an array HI I move a string into an array defined as: D ARD S 1 DIM(10) and try to move this field into a 10 pos. field in a PF but prgrm does NOT compile: RNF5343 30 1 Array has too many omitted indexes; specification is ignore -- 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) mailinglistTo 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-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.