|
Or what do you think about that.... D #array 4 dim(3) inz('Val1', 'Val2', 'Val3') This also would be useful for numeric arrays: D #array 5i 0 dim(3) inz(21, 22, 23) or like that: D #array dim(3) const(21, 22, 23) I ask me some times why IBM and RPG is normaly about one or two years behind other languages. Titus "Bob Cozzi" <cozzi@xxxxxxxxx> schrieb im Newsbeitrag news:004401c5fb4b$44583e80$6701a8c0@xxxxxxxxxxxxx > When did IBM start allowing the %DIV to be used on the D specs? > This was supposed to be in V3R1 but never got put in as far as I know. > This would be wonderful if it works. > > -Bob Cozzi > www.RPGxTools.com > RPG xTools - Enjoy programming again. > > > -----Original Message----- > From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] > On Behalf Of Kurt Anderson > Sent: Wednesday, December 07, 2005 10:17 AM > To: RPG programming on the AS400 / iSeries > Subject: RE: Initialize array in D-Spec > > Titus, > > Here is an example from a program of mine (with the individual field > names renamed to be generic for example). > > The point here is that one data structure is used as an array for > validation checks. And later when processing the group, I can perform > separate functions when checking if the group is equal to Group1 or > Group2 and so on (as opposed to comparing the value to vldOrdGrp(1) or > vldOrdGrp(2) and so on). > > * The valid Order Documentation Groups defined. > > D DS > > D OrdGrpDS 4a > > D Group1 1a Inz( 'H' ) Overlay( OrdGrpDS ) > > D Group2 1a Inz( 'U' ) Overlay( OrdGrpDS: > *Next ) > D Group3 1a Inz( 'I' ) Overlay( OrdGrpDS: > *Next ) > D Group4 1a Inz( 'E' ) Overlay( OrdGrpDS: > *Next ) > D vldOrdGrp Like( OrdGrp ) Overlay( OrdGrpDS ) > > D Dim( %div( %len( OrdGrpDS ): > > D %len( OrdGrp ) ) ) > > (OrdGrp is a file-defined field) > > > A more common version of this that I personally use is to not name the > values inside the data structure. > * The valid Order Documentation Groups defined. > > D DS > > D OrdGrpDS 4a Inz('H+ > D U+ > D I+ > D E') > D vldOrdGrp Like( OrdGrp ) Overlay( OrdGrpDS ) > > D Dim( %div( %len( OrdGrpDS ): > > D %len( OrdGrp ) ) ) > > Kurt Anderson > Application Developer > Highsmith Inc > > -----Original Message----- > From: rpg400-l-bounces@xxxxxxxxxxxx > [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Titus Kruse > Sent: Wednesday, December 07, 2005 8:59 AM > To: rpg400-l@xxxxxxxxxxxx > Subject: Initialize array in D-Spec > > Hi! > > What is a good way to initialize an array with different values in the > D-Specs? I want to replace the old fashioned way with tables and > constant data at the end of the program. Another reason is placing the > array in an include-sourcefile. Here is my example. But it doesn't work: > > d ds > d #array 4 dim(3) > d #value1 like(#array) overlay(#array) inz('Val1') > d #value2 like(#array) overlay(#array:*next) > inz('Val2') > d #value3 like(#array) overlay(#array:*next) > inz('Val3') > > > Titus > > > > -- > 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) 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) 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. > >
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.