[fpc-pascal] How to allocate a 2D array?
Arjan van Dijk
Arjan.van.Dijk at rivm.nl
Mon Jan 12 14:35:36 CET 2009
In my code I often use 2D arrays.
Until today, I kept the maximum dimension fixed to 400 * 300 points.
How can I make allocatable columns of ARBITRARY size?
For simplicity here a 1D reduction of the problem:
This is what I have:
MaxN = 400;
ColumnType = ARRAY[1..MaxN] OF Float;
Recently, some of my grids were so large that having all my grids use the
same maximum size
would cost too much memory. Therefore, I would like to dynamically
when the actual dimensions of a grid are known. I found:
ColumnTypePtr = ^ColumnType;
Column : ColumnTypePtr;
and now I have a column of size 400.
--> Question: How can I make allocatable columns of ARBITRARY size?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal