|
If I understand you right you could use input parms and redefine each field to point at an element of an array. I don't have any actual examples but here is what it would look like: I MONTH01 MnthArr(1) I MONTH02 MnthArr(2) I MONTH03 MnthArr(3) I MONTH04 MnthArr(4) I MONTH05 MnthArr(5) I MONTH06 MnthArr(6) I MONTH07 MnthArr(7) I MONTH08 MnthArr(8) I MONTH09 MnthArr(9) I MONTH10 MnthArr(10) I MONTH11 MnthArr(11) I MONTH12 MnthArr(12) Hope this helps, Aaron Bartell -----Original Message----- From: Frank Kany [mailto:frank.kany@hanoverfoods.com] Sent: Monday, May 14, 2001 4:07 PM To: RPG Mailing List (E-mail) Subject: Array as a field name? I have a file that has a field for each month of the year(each field holds the amount of pallets used that month). FILE: MONTHTOTAL A R RECORD PFILE(FLDREF) A CUSNO A MONTH01 A MONTH02 A MONTH03 A MONTH04 A MONTH05 A MONTH06 A MONTH07 A MONTH08 A MONTH09 A MONTH10 A MONTH11 A MONTH12 A K CUSNO When pallets get added or subtracted from the warehouse I want to update this file. Since this is May(MONTH05), I would like to update only field 'MONTH05' with the correct data. Is there a way to use an array as a field name? example: * * Array Index D X S 2P 0 * * Save Current Month into a work field C MOVEL UDATE X 2 0 * * Update HBI Customer Master Extension File C CUSNO SETLL MONTHTOT C CUSNO CHAIN MONTHTOT 90 * * Record Found; Update File Field C *IN90 IFEQ *OFF C EVAL MONTH(X) = CURTOTAL C ENDIF Thank you, Frank Kany +--- | 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 +--- +--- | 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-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.