1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Rep Power

    Lightbulb VBSCript - Large 2D Array - Sort - Issues

    Hello ,

    I have a 2D array of type as below.
    Need to sort it based on the second column , ie the Score.
    Score will always be a positive decimal.
    The number of rows will be between 400,000 to 900,000.
    Hence speed is very important

    Already tried Quicksort , speed is average
    But getting Out of Stack Space error , for certain cases (not all) of large number of rows.

    Ref :

    This code sample works very well for my use , except for the stack space / time issues.
    Please assist for coding a sorting block for the array.


    resultarray(0,1) = "Name1"
    resultarray(1,1) = "Score1"
    resultarray(2,1) = "Category1"
    resultarray(3,1) = "OtherDetail1"
    resultarray(4,1) = "OtherDetail1"
    resultarray(5,1) = "OtherDetail1"
    resultarray(0,2) = "Name2"
    resultarray(1,2) = "Score2"
    resultarray(2,2) = "Category2"
    resultarray(3,2) = "OtherDetail2"
    resultarray(4,2) = "OtherDetail2"
    resultarray(5,2) = "OtherDetail2"
    resultarray(0,3) = "Name3"
    resultarray(1,3) = "Score3"
    resultarray(2,3) = "Category3"
    resultarray(3,3) = "OtherDetail3"
    resultarray(4,3) = "OtherDetail3"
    resultarray(5,3) = "OtherDetail3"
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Rep Power
    I believe you'll always have problems with arrays of the size you mention. I would recommend you put your data in a database and then you can let the dbms do the sorting.
    Doug G
    I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton

IMN logo majestic logo threadwatch logo seochat tools logo