CLOSE all
PUBLIC array a1(5,2),a2(5)
a1(1,1)=6
a1(2,1)=4
a1(3,1)=9
a1(4,1)=7
a1(5,1)=2
for i=1 to 5
a2(i)=a1(i,1)
a1(i,2)=0
ENDFOR
Asort(a2,1,5,1)
FOR i=1 TO 5
FOR j=1 TO 5
IF a1(i,1)=a2(j)
a1(i,2)=j
ENDIF
ENDFOR
ENDFOR
?a1(1,1),a1(2,1),a1(3,1),a1(4,1),a1(5,1)
?a1(1,2),a1(2,2),a1(3,2),a1(4,2),a1(5,2)
运行结果:
6,4,9,7,2
3,2,5,4,1
此方法有点笨,大概达到你的要求了。