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).
    DierkNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kuxosude, Today, 02:17 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by PanicTrades, 05-10-2020, 08:45 AM
    6 responses
    71 views
    0 likes
    Last Post damon_achey  
    Started by soon123, Yesterday, 11:44 PM
    0 responses
    9 views
    0 likes
    Last Post soon123
    by soon123
     
    Started by Hyper, Yesterday, 11:10 PM
    0 responses
    5 views
    0 likes
    Last Post Hyper
    by Hyper
     
    Started by soon123, Yesterday, 10:20 PM
    0 responses
    5 views
    0 likes
    Last Post soon123
    by soon123
     
    Working...
    X