× 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 for the clarification. This is the way I have regarded dynamic memory
allocation. I try to keep the code simple, especially since they always want
it better! quicker! faster! now!



----- Original Message -----
From: "Hans Boldt" <boldt@ca.ibm.com>
Newsgroups: gmane.comp.lang.as400.rpg
To: <rpg400-l@midrange.com>
Sent: Friday, July 26, 2002 3:20 PM
Subject: Re: Reason for allocating memory


> Jon Paris wrote:
> > Absolutely - I would always use dynamic memory when I didn't know how
large
> > something (like an array) might become.  But it is an unusual situation.
If
> > I want a fixed length field of 256 - I specify it.  The point I was
making
> > was that the programmer in question didn't know RPG - not that dynamic
> > memory was a bad thing - just that it was a bad _RPG_ example.
>
> I've argued this point before.
>
> If you're likely to have a relatively small amount of dynamic data,
> I'd just stick with a static array, instead of dynamically
> allocating storage based on the actual number of elements.  Note
> that if you dynamically allocate and reallocate storage as your
> number of elements changes during processing, you're incurring a
> fairly heavy overhead for that processing.
>
> On the other hand, if you have a large amount of dynamic data,
> you're probably better off using a database file.
>
> Either way, you end up not having to deal with those nasty pointers,
> the "goto" of data structures.
>
> Cheers!  Hans
>
>
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> 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 ...

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.