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 Unsuitable, Today, 06:30 PM
    0 responses
    2 views
    0 likes
    Last Post Unsuitable  
    Started by michaelsh, Today, 04:28 PM
    0 responses
    4 views
    0 likes
    Last Post michaelsh  
    Started by Bmatarese, Today, 03:13 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by sdauteuil, Today, 12:32 PM
    4 responses
    17 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Gaterz, 09-27-2020, 05:52 PM
    10 responses
    51 views
    0 likes
    Last Post tcea9
    by tcea9
     
    Working...
    X