|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Sorting arrays HELP !!
<i><b>Originally posted by : Adam Sissman (adam@sissman.co.uk)</b></i><br />I want to be able to sort 2 different arrays by the number in one of the arrays...<br /><br />Arrays for...<br />Price<br />Store<br /><br />I want to be able to sort both arrays by the price, ie cheapest at the top. Any ideas<br /><br />Thanks for any help !
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : Malathi (malathi@mailcity.com)</b></i><br />Try out ... assuming Price & Store are the arrays with n vals.<br /><br />for i = 1 to n-1<br /> for j = i+1 to n<br /> if Price(i)>Price(j) Then<br /> t = Price(j)<br /> Price(j) = Price(i)<br /> Price(i) = t<br /> t = Store(j)<br /> Store(j) = Store(i)<br /> Store(i) = t<br /> End If<br /> next<br />next<br /><br /><br /><br />------------<br />Adam Sissman at 6/18/2000 7:17:51 PM<br /><br />I want to be able to sort 2 different arrays by the number in one of the arrays...<br /><br />Arrays for...<br />Price<br />Store<br /><br />I want to be able to sort both arrays by the price, ie cheapest at the top. Any ideas<br /><br />Thanks for any help !
|
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > Sorting arrays HELP !! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|