|
I'm assuming you are referring to the multiplication version of the array
he showed me. I was wondering if the first way,
<SNIP>
Here's a sample that uses a qualified DS:
D Test1 ds
D Cost 20 3
D Price 20 3
D Cols ds qualified
D dim(6)
D Value likeds(Test1) dim(5)
D x s 10I 0
D y s 10I 0
/free
// set all Costs to 50 & Prices to 100.
for x = 1 to %elem(Cols);
for y = 1 to %elem(Cols.Value);
Cols(x).Value(y).Cost = 50;
Cols(x).Value(y).Price = 100;
endfor;
endfor;
// set cost(3,2) to 55 and Price(3,2) to 105
Cols(3).Value(2).Cost = 55;
Cols(3).Value(2).Price = 105;
/end-free
<SNIP>
can be converted to RPGIV. If not I'll blend it in. I like this approach
better than the multiplication one. Easier to see what's going on.
Ron Power
Programmer
Information Services
City Of St. John's, NL
P.O. Box 908
St. John's, NL
A1C 5M2
Tel: 709-576-8132
Email: rpower@xxxxxxxxxx
Website: http://www.stjohns.ca/
___________________________________________________________________________
Success is going from failure to failure without a loss of enthusiasm. -
Sir Winston Churchill
Jderham2@xxxxxx
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
07/06/2004 11:33 AM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
To
rpg400-l@xxxxxxxxxxxx
cc
Subject
Re: 2 dim array
In a message dated 7/6/2004 7:42:33 AM Eastern Daylight Time,
RPower@xxxxxxxxxx writes:
> Interesting. Thank you for that help. I think I will use that. Can I
> use that way in fixed format instead of free format? We don't use Free
> here ( :( ) so I'd have to code it in fixed.
That approach has been around for a very long time and be used in any code
that generate the required arithmetic results for pointers. As a matter of
fact,
if you follow that logic you can establish an N dimensional array.
Jack Derham
Direct Systems, Inc.
Marietta, GA
--
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 OutBound email has been scanned for Viruses
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.