# Re: 有关写排序程式问题

Posted by 老怪 on October 01, 1998 at 18:21:05:

In Reply to: 有关写排序程式问题 posted by fanny on October 01, 1998 at 10:55:20:

: 我现在要用vb写排序程式,我要如何写阵列,vb可以交换val的数字吗?如果可以那要用那一个指令?
: 请回答我一下,谢谢! 拜托了!

Dim varArray(20)
Dim Temp
Dim I as long,J as long

For I=0 to Ubound(varArray)
For J=I to Ubound(varArray)-1
If varArray(i)>varArray(J)
Temp=varArray(i)
varArray(i)=varArray(j)
varArray(j)=Temp
End if
next
next

Follow Ups: