nick447923
Member
- Joined
- Nov 10, 2009
- Messages
- 14
- Programming Experience
- Beginner
I am writing an auto insurance application. I need to sort a three dimensional array in descending order based on an integer value in third field in the array.
The CalcPremium function returns an integer value.
Dim CarDriverArray(3, 3)
CarDriverArray(0, 0) = "D1"
CarDriverArray(0, 1) = "C1"
CarDriverArray(0, 2) = CalcPremium()
CarDriverArray(1, 0) = "D2"
CarDriverArray(1, 1) = "C1"
CarDriverArray(1, 2) = CalcPremium()
CarDriverArray(2, 0) = "D3"
CarDriverArray(2,1) = "C1"
CarDriverArray(2,2) = CalcPremium()
I need to sort the CalcPremium element in the array in descending order.
I tried using the sort function but it states it requires a one dimensional array. How would this be accomplished?
The CalcPremium function returns an integer value.
Dim CarDriverArray(3, 3)
CarDriverArray(0, 0) = "D1"
CarDriverArray(0, 1) = "C1"
CarDriverArray(0, 2) = CalcPremium()
CarDriverArray(1, 0) = "D2"
CarDriverArray(1, 1) = "C1"
CarDriverArray(1, 2) = CalcPremium()
CarDriverArray(2, 0) = "D3"
CarDriverArray(2,1) = "C1"
CarDriverArray(2,2) = CalcPremium()
I need to sort the CalcPremium element in the array in descending order.
I tried using the sort function but it states it requires a one dimensional array. How would this be accomplished?