Jagged Arrays

  • 15 years ago
    This is what I am attempting to do:
    Create an array of arrays (jagged)
    Start at [0, 0] and add values to successive elements of that.  So:
    [0, 0] = 25
    [0, 1] = 13
    [0, 2] = 27
    and so on.  Then, when all of the elements of that first array  add up to a certain amount, I need to move on to the next array and start adding values to that
    [1, 0] = 15
    [1, 1] = 10


    As a complete example, lets say the limit that all the elements in the array can add up to is 10.
    [0, 0] = 5
    [0, 1] = 3
    [0, 2] = 2
    'Whoops, ran out of room for the number I want to add next (any number greater than 0 would put me over the limit)
    [1, 0] =  5
    [1, 1] = 2
    'Whoops, ran out of room for the number I want to add next (lets say 4)
    [2, 0] = 4
    and so on.  How do you code this?





















  • 15 years ago

    Who would of thought hours of trauma could be caused by the lack of one little Preserve keyword...  Ick! [+o(]
    Problem solved.






Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“If Java had true garbage collection, most programs would delete themselves upon execution.” - Robert Sewell