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



On 2017-03-08 12:43 AM, Dan wrote:
I am looking at dynamically sized arrays to solve a problem that's been
biting us in the ass lately with attempts to add an element to an array
past the number of elements defined for the array. Currently, our arrays
handle 99.999% of the volume we throw at them, but then we get an outlier
that exceeds the definition and creates a whopper of a headache for us.


Did you run into some problem when you change the dimension of the original array to 5000?

If you want to use the dump to see the contents of the array, the dump will only work reliably if the entire defined dimension of the array is allocated.

So unless you had an issue with the non-based array having a dimension of 5000, I would just remove the based keyword.

Otherwise, if you do need to make the array based, I would avoid using DUMP. And I would use a mechanism like Mihail's if there was even the slightest risk that somebody would access the array incorrectly in the future.

About being able to access more elements than you allocated, it is very dangerous to play with that even as an experiment. The storage following your allocation might be storage allocated to some other program in your job, and modifying that storage could cause any number of bad things to happen. It's very likely that a different bad thing might happen each time you tried it.


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.