Large Array 
Author Message
 Large Array

Quote:

> I want to create an Array with the size of 800*600 (coordinates). It
> is supposed to be a two dimensional mountain. Each pixel must get an
> X and Y value.

If I understand correctly you want an array of 800x600 where each entry
has two values: X and Y. If I misunderstood then modify XYRecord and use
something else instead of GetX, GetY and SetXY.

So:

program BigArrayDefinitions;
Const
  M=600;
  N=800;

type
  XYRecord = record  { this is an array element }
  X,Y : real;
  end;

  pVector=^tVector;                   { a pointer to a single vector }
  tVector = array [1..M] of XYRecord; { the vector }
var
  BigArray : array [1..N] of pVector; { a vector of pointers to vectors }

procedure Init;
var i:integer;
begin
  for i:=1 to N do new(BigArray[i]); { the actual creation of the vectors }
end;

procedure SetXY(i,j:integer;aX,aY:real);
begin
  BigArray[i]^[j].X:=aX;
  BigArray[i]^[j].Y:=aY;
end;

function GetX(i,j:integer):real;
begin
  GetX:=BigArray[i]^[j].X;
end;

function GetY(i,j:integer):real;
begin
  GetY:=BigArray[i]^[j].Y;
end;

begin
  init;

  { Put your code here. The following is just an example. }
  SetXY(100,500,3.7,19.3);
  writeln(GetX(100,500));

end.



Sat, 05 Dec 1998 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. large array..

2. large arrays of globals

3. Large array supports.

4. Large array

5. Q: storing large arrays

6. Help! Large Array

7. I need to make a large array for my Computing A-Level project - can you help

8. I need to make a large array for my Computing A-Level project - can you help

9. GetBitmapBits and LARGE arrays

10. FFT of large array (2**20 real points)

11. Large Arrays...

12. large arrays (TP 6.0)

 

 
Powered by phpBB® Forum Software