Hello,
I am using a 2-dimensional array to retrieve results from my database and display them. Each record has 6 values and I place them into the array one after the other using the For loop script below. Once all of the records are stored in the ARRAY they will be ordered using QuickSort and then displayed. The order of each record depends on a number that is returned for each record from the database.
Dim problemArray(100,2)
For i=0 to UBound(dataArray)-6 Step 6
problemArray(i,0) = dataArray(i)
problemArray(i,1) = dataArray(i+4)
Next
Call QuickSort(problemArray)
' At this point we use a FOR loop to retrieve the ordered values from QuickSort and display them.
THE PROBLEM:
The problem is the way we declare the problemArray. If 'problemArray' has a too low first dimension, an ASP error will be received in the moment of the loop AFTER THE QUICKSORT (Display Results loop). If we assign a higher number to that dimension (from my tests higher with 100), the QuickSort function will return an "OUT OF STACK" error. This is a recursive function.
How can we create the problemArray without being forced to assign a specific number (at least for the first dimension). ReDim isn't the option. Something that in the case of the single dimension arrays we achieve by using Split function for a string.
Standard SQL ordering is not an option as all ordering of database results is accomplished using ASP script and a RANK number returned with every record by the database.
Any adice would be appreciated.
Jeff
I am using a 2-dimensional array to retrieve results from my database and display them. Each record has 6 values and I place them into the array one after the other using the For loop script below. Once all of the records are stored in the ARRAY they will be ordered using QuickSort and then displayed. The order of each record depends on a number that is returned for each record from the database.
Dim problemArray(100,2)
For i=0 to UBound(dataArray)-6 Step 6
problemArray(i,0) = dataArray(i)
problemArray(i,1) = dataArray(i+4)
Next
Call QuickSort(problemArray)
' At this point we use a FOR loop to retrieve the ordered values from QuickSort and display them.
THE PROBLEM:
The problem is the way we declare the problemArray. If 'problemArray' has a too low first dimension, an ASP error will be received in the moment of the loop AFTER THE QUICKSORT (Display Results loop). If we assign a higher number to that dimension (from my tests higher with 100), the QuickSort function will return an "OUT OF STACK" error. This is a recursive function.
How can we create the problemArray without being forced to assign a specific number (at least for the first dimension). ReDim isn't the option. Something that in the case of the single dimension arrays we achieve by using Split function for a string.
Standard SQL ordering is not an option as all ordering of database results is accomplished using ASP script and a RANK number returned with every record by the database.
Any adice would be appreciated.
Jeff