求助高手编辑一段VBS代码
vbs我是一个菜鸟!求助高手帮忙编辑一段VBS代码,已知有A,B,C代表三个数,请用vbs先给这三个数从大到小排序!在按下面的函数公式编辑一下!Max((A-B)+1,(C-B)+11,(B-A)+12),不知道能不能看明白!
[ 本帖最后由 qiwa 于 2012-5-25 10:01 编辑 ]
Option Explicit Option Base 1 Private Sub cmdCommand1_Click() Dim Nums(3) As Integer, PN, i, j Dim a, b, c If IsNumeric(txtText1.Text) = True And IsNumeric(txtText2.Text) = True And IsNumeric(txtText3.Text) = True Then Nums(1) = CInt(txtText1.Text): Nums(2) = CInt(txtText2.Text): Nums(3) = CInt(txtText3.Text) For i = 1 To UBound(Nums) For j = 1 To (UBound(Nums) - (i + 2)) If Nums(j) > Nums(j + 1) Then PN = Nums(j) Nums(j) = Nums(j + 1) Nums(j + 1) = PN End If Next j Next i a = Nums(1) - Nums(2) + 1: b = Nums(3) - Nums(2) + 11: c = Nums(2) - Nums(1) + 12 MsgBox a & " | " & b & " | " & c End If End Sub