Results 1 to 4 of 4

Thread: [RESOLVED] [2005] Array Sizes

  1. #1

    Thread Starter
    Hyperactive Member Tarablue's Avatar
    Join Date
    Feb 2007
    Location
    Somewhere West of GMT
    Posts
    398

    Resolved [RESOLVED] [2005] Array Sizes

    Hello All,

    Just a general question on the size of arrays.

    What is better, one very large array or several smaller ones. In one section of my program I have four arrays of varying sizes. If I combine them together I end up with an array some 48 rows by 52 columns.

    Best Rgds,
    Tarablue

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [2005] Array Sizes

    It should make almost no difference as long as you are using arrays, and neither of those sizes are all that big. However, once you start mentioning multi-dimensional arrays, there are quite likely to be alternatives to arrays that are easier to work with. For example, a datatable makes a bit more sense if you are talking about tabular data, which is what it sounds like when you say x rows by y columns. Easier to work with a datatable than a monstrosity of a multi-d array.

    Another example would be to make the columns into fields in a class or structure, then use a List (of <that class or structure>). Lists are also easier to use than arrays, but a class with that number of members would be a bit unwieldly.
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    Hyperactive Member Tarablue's Avatar
    Join Date
    Feb 2007
    Location
    Somewhere West of GMT
    Posts
    398

    Re: [2005] Array Sizes

    Hello Shaggy Hiker,

    OK, size really doesn't matter but I agree that it is easier to alter a smaller one than a larger one. As for DataTable, I looked at this before and found it a rather daunting task at the time. Maybe I will need to set aside some time in which to go through it more thoroughly.

    Best Rgds,
    Tarablue

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [RESOLVED] [2005] Array Sizes

    There is a situation where one big array is better than a bunch of small ones, but it doesn't apply to VB.NET. In a language such as C, you could use pointer arithmetic to rapidly move thing around, and work with the array. Since you don't have pointers in VB.NET (officially, anyways), that doesn't apply. For that matter, array items in VB.NET may not even be stored in contiguous memory blocks, which would invalidate pointer arithmetic anyways.
    My usual boring signature: Nothing

Posting Permissions

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



Click Here to Expand Forum to Full Width