× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks,
That's what I was thinking.  Appreciate the confirmation.

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




Hans Boldt <boldt@xxxxxxxxxx> 
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
07/15/2004 11:54 AM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
rpg400-l@xxxxxxxxxxxx
cc

Subject
Re: %Xfoot and two-dim array?






RPower@xxxxxxxxxx wrote:
> I have a two dim array and trying to use Xfoot on a numeric field, but I 

> can't seem to get the syntax right.  Here's what I've got:
> 
> d Sf5rec          ds 
> d   Dsc                         30 
> d   Cde                         10 
> d   Sub                          5 
> d   Amt                          9  2
> d   Ccm                          1 
> d   Csh                          9  2
> d   Chq                          9  2
> d   Dbt                          9  2
> d   Crc                          9  2
> d   Cnt                          3  0
> 
> d Cols            ds                  qualified 
> d                                     dim(50) 
> d   Record                            LikeDs(Sf5Rec) dim(50)
> 
> c                   Eval      Pay_Cnt = Pay_Cnt + 
> c                             %Xfoot(Cols(x).Record.Cnt)
> 
> I get a compile error on the %Xfoot.  Any ideas?  Should I be using an 
> index on the Record portion as well?
> ...

First, "Cols(x).Record.Cnt" is not a valid qualified name expression 
since you didn't specify an array index on "Record". Second, the 
expression does not reference an array - "Cnt" is a scalar variable.

What should you do? Code something like:

     sum = 0;
     for i = 1 to 50;
         sum += Cols(x).Record(i).Cnt;
     endfor;
     Pay_Cnt += sum;

That is, you can't use %XFOOT for this situation.

Cheers! Hans

--
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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.