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



Don,

That's pretty much how I was doing it when I started.
In this program, the array can be allocated/deallocated multiple times.
Upon the 2nd allocation (after a deallocation), the array had the values
that were loaded previously.  This caused an issue.
Now, when that happened, I was doing a DEALLOC.  I've since changed it
to use the NULL extender - DEALLOC(N).  I wasn't sure if that was the
cause of my problems or not, so I figured I'd initialize the newly
allocated elements. 


Kurt Anderson
Application Developer
Highsmith Inc

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Fisher, Don
Sent: Thursday, May 26, 2005 7:53 AM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: dynamic array initialization

I never worry about initializing the occurrences.  Since I have to track
how many I've loaded anyway, I just use that value to avoid referring to
an uninitialized occurrence.

Hope that helps.

Donald R. Fisher, III
Project Manager
Roomstore Furniture Company
(804) 784-7600 extension 2124
DFisher@xxxxxxxxxxxxx

<clip>
I'm coding my first dynamic array into an rpg application (thanks to the
example code provided in an email to this list by Scott Klement).  From
reading the IBM help, it appears that "The newly allocated storage is
uninitialized."   So, I'm initializing the new elements that I'm adding
to
the array.  Is this standard practice?  Do I need to do this if I use
the keyword INZ on the array definition?  Is there any way I can
automate the initialization through a keyword instead of using the FOR
loop in the subroutine below?
<clip>
--
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 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.