- Joined
- Nov 13, 2006
- Messages
- 1,814
example:
int[1]=3
int[2]=2
int[3]=1
int[4]=4
how can i order this to desc?
i tryed make a loop
like this
we got a index lets call it "index", we compare this with other index
for a = 1 to max array index
if index > a
i=int[a]
int[a]=int[index]
int[index]=i
endif
endloop
this work well until difference between a and index is 1, but example if a = 1 and index = 4 and its swap each other then even a maybe higher than 2 and 3 but its get the 4th position
(i want make this in gui)
sorry for crap english
int[1]=3
int[2]=2
int[3]=1
int[4]=4
how can i order this to desc?
i tryed make a loop
like this
we got a index lets call it "index", we compare this with other index
for a = 1 to max array index
if index > a
i=int[a]
int[a]=int[index]
int[index]=i
endif
endloop
this work well until difference between a and index is 1, but example if a = 1 and index = 4 and its swap each other then even a maybe higher than 2 and 3 but its get the 4th position
(i want make this in gui)
sorry for crap english