|
Most of the time you have to check before using an array if the index (the nummeric value) is within the allowed range. Not zero and not greater than the max. array size defined in your program. When so, execute an error routine or somekind, so that your programmaing will not go wrong. Regards, Henk. -----Original Message----- From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On Behalf Of leszek.gruszczynski@big.pl Sent: Thursday, 11 July, 2002 9:35 AM To: rpg400-l@midrange.com Subject: RE: Array index is not valid Index of array that You set is to low , or set to high. Example: This is array D PMS S 78 DIM(05) CTDATA PERRCD(1) and my index: D XX S 2 0 Field XX must be have value from 1 to 5. When field XX was value 0 or greater then 5: This is wrong code!!! eval aa = PMS(0) or eval aa = PMS(6) Regards Leszek Gruszczynski -----Oryginalna wiadomooeæ----- Od: sas [mailto:sas@toto.co.id] Wys³ano: 11 lipca 2002 08:39 Do: rpg400-l@midrange.com Temat: Array index is not valid > Dear all , > I am very start learning RPG, I get message " array index is not valid" > many times , below the joblog > Message ID . . . . . . : RPG0121 Severity . . . . . . . : 99 > Message type . . . . . : Inquiry > Date sent . . . . . . : 07/11/02 Time sent . . . . . . : 14:07:24 > > Message . . . . : The PGM1 144100 array index is not valid (C G S D F). > Cause . . . . . : The RPG program PGM1 in library TEST tried to use the > array index at statement 144100 which was less than one or greater than > the > number of elements in the array. > Please advise , how to solve the problem > Thank you > Regards > sas > > _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com 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) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com 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.