Results 1 to 11 of 11

Thread: Multi-Dimensional arrays

  1. #1
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    1,124
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default Multi-Dimensional arrays[fixed]

    How would one add values to the arrays inside of arrays?
    ie

    Lol[0][0..100]
    Lol[1][0..100]

    lol[0][0] := z;
    lol[0][1] := b;

    works but that creates a lot of unneeded lines and work for me.
    Last edited by Capricorn; 06-22-2009 at 10:41 AM.

  2. #2
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Have you tried array of array of Integer;? :]

  3. #3
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    1,124
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    I can access them just fine, and it has nothing to do with what they are a array of. I can add to the second arrays just fine doing it one by one, but I cant go like:

    lol[0] := [1, 2, 3]

    I have to go
    Lol[0][0] := 1;
    lol[0][1] := 2;

    etc etc.

    And for the sake of someone coming along saying just do inc and a for loop, I am not trying to store increasing numbers and this is all for the sake of an example.

  4. #4
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    umm..

    SCAR Code:
    for i := 0 to 9 do
      Lol[0][i] := i;

    ?

  5. #5
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    for i := 0 to high(lol[0]) do or something? tbh im not sure how you can add them faster.
    “Ignorance, the root and the stem of every evil.”

  6. #6
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What Blumblebee and I both said would work, I think.

  7. #7
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Can you please restore the post to what you had before?

  8. #8
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    1,124
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    Can you please restore the post to what you had before?
    Done, can't imagine why though.

  9. #9
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Did you get your answer?

  10. #10
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    1,124
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Not from you guys :P, I said in my second post that I was using those as a example, not what I actually wanted to perform.

    My real problem was that I was doing Lol := [1,2,3,4,etcetc]; when I had set the value already. All I had to do was take away the [0..100] from the declaration of the array and it worked.

    Thanks aways.

  11. #11
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    For archival purposes .

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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