Board index » delphi » Setting the maximum limit for an array

Setting the maximum limit for an array

On Fri, 11 Dec 1998 01:12:51 +0800, "Imran Bin Abdul Rahman"

Quote
<bu...@pacific.net.sg> wrote:
> I would like to declare an array such that it has an upper limit
> determined by memory capacity. I'm more familiar with C,
> so it's like the BUFSIZ variable in C which can be used to
> declare the maximum limit of an array with respect to memory conditions.
> Anybody with examples & solutions?

BUFSIZ is no variable in C. It is a macro defined by the
implementation and it denotes the implicit size of file buffers. It
has nothing to do with arrays allocated by the programmer.

In TP you may declare dynamicyl data structures on the heap up to a
size of $FFF8 bytes per data structure (array) and as many as your
total DOS memory available at _run_ _time_ allows.

Statically declared data may sum up to a total of 64k for the whole
program - units included. There is no way to find out at compile time
which is the maximum allowable array size than by trial and error.
Such a function would be plainly useless.

Regards
Horst

 

Re:Setting the maximum limit for an array


I would like to declare an array such that it has an upper limit
determined by memory capacity. I'm more familiar with C,
so it's like the BUFSIZ variable in C which can be used to
declare the maximum limit of an array with respect to memory conditions.
Anybody with examples & solutions?

Thanks.

Other Threads