Results 1 to 10 of 10

Thread: Help large multidimensional arrays

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Smile Help large multidimensional arrays

    I'm trying to create a three dimensional array, I assume it needs to be a pointer. I'm trying to create an array that hold the x,y,z coordinates in the array while inputing the color number like this:

    var
    threeDcolornumberRED : array[-32768..32767,-32768..32767,-32768..32767] of byte;
    threeDcolornumberGREEN : array[-32768..32767,-32768..32767,-32768..32767] of byte;
    threeDcolornumberBLUE : array[-32768..32767,-32768..32767,-32768..32767] of byte;
    ---
    threeDcolornumberRED[X,y,z]:=255;
    threeDcolornumberGREEN[X,Y,Z]:=255;
    threeDcolornumberBLUE[X,y,z]:=255;

    first question is that possible using negatives in the array structure? I got it to compile but it would always crash with access violation error.
    not sure if its the way i was defining the pointer, or am i just running out of memory? I have 8 mb running on windows 7 using free pascal 2.6.2 (win32)

    I need this to work so that I can convert the 2d version of this AI program i made with pixels representing organisms that move around and interact. I want to use the array data to determine their location and also allow them to move through this array I can figure out the details, just need help with defining the array or maybe a different approach.....Id hate to have to write to a file and read it to get the data working right...{slow}

    Not sure if I've given enough info but maybe some one has some ideas. I have tried multiple tutorials on arrays, nothing i tried worked right, sometimes it would compile but would always crash no matter what i tried I even made the arrays smaller and non negative to see if that was the problem didn't matter. So if you could show how you define the pointer stuff as well would be helpful. Thanks in advance folks.
    Last edited by siv@; 18-01-2015 at 05:52 PM. Reason: correction

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •