vb高手来回答!下面代码的每句解释和每一部分的大概作用

[复制链接]
查看11 | 回复2 | 2011-6-30 09:50:23 | 显示全部楼层 |阅读模式
If w = 1 Then
'1级

If j = 1 Then

If Mid(t1, 1, 1) = "(" Then
'323212132

p = Val(Mid(t1, 2, Len(t1)))

Else

p = Val(t1)

End If

If Mid(t1, b(1) + 1, 1) = "(" Then
'323212132

q = Val(Mid(t1, b(1) + 2, Len(t1)))

Else

q = Val(Mid(t1, b(1) + 1, Len(t1)))

End If



t1 = p * q

Else

If Mid(t1, 1, 1) = "(" Then
'323212132

p = Val(Mid(t1, 2, Len(t1)))

Else

p = Val(t1)

End If

If Mid(t1, b(1) + 1, 1) = "(" Then
'323212132

q = Val(Mid(t1, b(1) + 2, Len(t1)))

Else

q = Val(Mid(t1, b(1) + 1, Len(t1)))

End If



s = p * q



t1 = s & Mid(t1, b(2), Len(t1))

End If

ElseIf j = w And j > 1 Then
'1级

If Mid(t1, b(w - 1) + 1, 1) = "(" Then

p = Val(Mid(t1, b(w - 1) + 2, Len(t1)))

Else

p = Val(Mid(t1, b(w - 1) + 1, Len(t1)))

End If

If Mid(t1, b(w) + 1, 1) = "(" Then

q = Val(Mid(t1, b(w) + 2, Len(t1)))

Else

q = Val(Mid(t, b(w) + 1, Len(t)))

End If



s = p * q

If s1 Then
'1级

If Mid(t1, b(w - 1) + 1, 1) = "(" Then

p = Val(Mid(t1, b(w - 1) + 2, Len(t1)))

Else

p = Val(Mid(t1, b(w - 1) + 1, Len(t1)))

End If

If Mid(t1, b(w) + 1, 1) = "(" Then

q = Val(Mid(t1, b(w) + 2, Len(t1)))

Else

q = Val(Mid(t1, b(w) + 1, Len(t1)))

End If

s = p * q

If s < 0 Then

t1 = Mid(t1, 1, b(w - 1)) & "(" & s & ")" & Mid(t1, b(w + 1), Len(t1))

Else

t1 = Mid(t1, 1, b(w - 1)) & s & Mid(t1, b(w + 1), Len(t1))

End If

End If

回复

使用道具 举报

千问 | 2011-6-30 09:50:23 | 显示全部楼层
If w = 1 Then
'W=1时
If j = 1 Then'W=1W且J=1时
If Mid(t1, 1, 1) = "(" Then
'W=1、J=1且字符串变量t1的第一个字符为"("时
p = Val(Mid(t1, 2, Len(t1)))'则P的值为字符串变量t1从第二个字符开始的所有字符
Else  '如果t1的第一个字符不是"("
p = Val(t1)
'则P的值为t1转换为数字的值
End If
If Mid(...
回复

使用道具 举报

千问 | 2011-6-30 09:50:23 | 显示全部楼层
Dim p()Private Sub Command1_Click()ScaleMode = 3 '把鼠标的屏幕坐标转换为Form1的客户坐标Picture1.AutoRedraw = True '自动重绘picture1内的内容,即控件经过picture时,仍保留原图像Picture1.ScaleMode = 3 '图像度量单位w = ...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行