排序不能把变量名搞丢了,是个难题。
心生万象,万象皆程序!
本人计算机知识网:http://bbs.为防伸手党,本站已停止会员注册。
[此贴子已经被作者于2022-11-23 16:43编辑过]
arr1 = Array(a(1).年龄, a(2).年龄, a(3).年龄) For m = 0 To UBound(arr1) For i = m + 1 To UBound(arr1) k = arr1(m) If arr1(m) > arr1(i) Then arr1(m) = arr1(i) arr1(i) = k End If Next MsgBox arr1(m) Next
arr1 = Array(a(1), a(2), a(3)) For m = 0 To UBound(arr1) For i = m + 1 To UBound(arr1) k = arr1(m) If arr1(m).年龄 > arr1(i).年龄 Then arr1(m) = arr1(i) arr1(i) = k End If Next MsgBox arr1(m) Next