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



Arrays have a similar limitation in the number of elements as fields do in
the number of bytes. 
It is currently 32k (fields are 64k as Scott mentioned). But those 32k
elements may be up to 64k in length.
RPG opcodes work on up to 64k fields today. The scan opcode, will not allow
you to specify a value more than 64k in length. 

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Scott Klement
Sent: Friday, February 18, 2005 10:53 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Pointer suggestion


> I see the point about using an array since it is passed by reference
rather
> then value. But I was thinking more along the lines of the amount of data
> that can be passed to a variable. I believe the max size would be around
> 32k.

32k is the (old) maximum size for a single alphanumeric field in RPG. 
Today that limit is 64k.

However, it's not (and AFIAK, never has been) the maximum for an array. 
An array can potentially be as large as 16mb in size (actually, 1k less 
than that)


> The record length I  will be using is around 250. If I need to return
> say 500 records, that would put me way beyond that variable size limit.
Does
> using pointers allow me to access a greater amount of data?

500x250 = 125000 (approx 123k) you should have absolutely no problem 
passing that as an array.

And the code will be much nicer to read without the pointer logic.  Just 
be careful to make sure that the array definition is the same in both the 
caller and callee.  Use a /copy member with a prototype to enforce this.

Good luck!

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