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



Scott, my reading of the question is that the OP wants a way to define
the addresses in such a way that he can process them as an array without
doing those 6 evals, and off the top of my head, I don't think he can.

Trevor Briggs
Analyst/Programmer
Lincare, Inc.
(727) 431-1246
TBriggs2@xxxxxxxxxxx

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Monday, March 03, 2014 12:33 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Treat file fields as an array

Hi Charles,

I'm not sure that I understand what you're asking. You have two
addresses and you want to load them into an array, so you want to do
this?

Cust(1).Customer = BTCustomer;
Cust(1).Name = BTName;
Cust(1).Address1 = BTAddress1;

Cust(2).Customer = STCustomer;
Cust(2).Name = STName;
Cust(2).Address1 = STAddress1;

I'm pretty sure you could type those 6 lines above without asking the
question, which makes me think I'm not understanding... Are you looking

to load all records in the file into the array, and have separate arrays

for bill-to and ship-to? Or... ? I guess I'm just not sure what you're

looking for.


On 3/3/2014 11:08 AM, Charles Wilt wrote:
I've got a file with "bill to" and "ship to" information in addition
to
other fields.

So for instance
A OTHERFLD1 10A
A OTHERFLD1 10A
A BTCUSTOMER 6S 0 COLHDG('Bill To'
'Customer')
A BTNAME 30A COLHDG('Bill to' 'Name')
A BTADDRESS1 30A COLHDG('Bill to' 'Address
1')
A STCUSTOMER 6S 0 COLHDG('Ship To'
'Customer')
A STNAME 30A COLHDG('Ship to' 'Name')
A STADDRESS1 30A COLHDG('Ship to' 'Address
1')


I'd really like to get the Bill to/ship to fields into an array so I
can
easily load them without repeating the evals.

something like:
Cust(1) = GetCustinfo(wBtCustomer);
Cust(2) = GetCustInfo(wStCustomer);
//eval-corr here perhaps?

I think I remeber a way to do it, but my memory is a little rusty and
I
might be missing an easier way enable by recent enhancements.

So I thought I'd throw this out to the group. I'm running 7.1 w/TR 7.

Thanks!
Charles


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.