Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Array manipulation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Array manipulation

    I can use a while loop to move data one direction or another in my (rather large) array.

    But isn't there a more efficient way? Something like "OK array, offset everything down three" that would leave the three at the top clear and truncate the last three.

    I poked arround the MSDN site and the Clear method would work if I could then sort them but the Sort method only works on one dimnsional arrays

    #2
    >> But isn't there a more efficient way?
    Not that I know of.

    Hints:
    a) Rather than moving items you might consider adjustingyour access index by 3. No need to physically move items.
    b) If you really want to get rid of the "oldest" items then you might consider looking for an alternate collection like e.g. queue (see MSDN docs).

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    561 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    325 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    547 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X