Public Sub Command4_Click()
txt1 = Val(Text1)
txt2 = Val(Text2)
txt3 = Val(Text3)
txt4 = Val(Text4)
txt5 = Val(Text5)
txt6 = Val(Text6)
txt7 = Val(Text7)
txt8 = Val(Text8)
txt9 = Val(Text9)
txt10 = Val(Text10)
txt11 = Val(Text11)
txt12 = Val(Text12)
txt13 = Val(Text13)
txt14 = Val(Text14)
txt15 = Val(Text15)
txt16 = Val(Text16)
txt17 = Val(Text17)
txt18 = Val(Text18)
txt19 = Val(Text19)
txt20 = Val(Text20)
txt21 = Val(Text21)
txt22 = Val(Text22)
txt23 = Val(Text23)
txt24 = Val(Text24)
txt25 = Val(Text25)
txt26 = Val(Text26)
txt27 = Val(Text27)
txt28 = Val(Text28)
txt29 = Val(Text29)
txt30 = Val(Text30)
txt31 = Val(Text31)
txt32 = Val(Text32)
txt33 = Val(Text33)
txt34 = Val(Text34)
txt35 = Val(Text35)
If Val(Text27) = 0 Then
MsgBox "轴向进给量不可能为0"
End If
ca = Fix((Val(Text21) - Val(Text1)) / 2 / Val(Text27) + 2)
cb = Fix((Val(Text21) - Val(Text2)) / 2 / Val(Text27) + 2)
cc = Fix((Val(Text21) - Val(Text3)) / 2 / Val(Text27) + 2)
cd = Fix((Val(Text21) - Val(Text4)) / 2 / Val(Text27) + 2)
ce = Fix((Val(Text21) - Val(Text5)) / 2 / Val(Text27) + 2)
ta = Val(Text6) * ca / Val(Text26) / Val(Text25)
tb = Val(Text6) * cb / Val(Text26) / Val(Text25)
tc = Val(Text6) * cc / Val(Text26) / Val(Text25)
td = Val(Text6) * cd / Val(Text26) / Val(Text25)
te = Val(Text6) * ce / Val(Text26) / Val(Text25)
xta = 2 * Val(Text11) * Val(Text16) / Val(Text28) / Val(Text29) / Val(Text30)
xtb = 2 * Val(Text12) * Val(Text17) / Val(Text28) / Val(Text29) / Val(Text30)
xtc = 2 * Val(Text13) * Val(Text18) / Val(Text28) / Val(Text29) / Val(Text30)
xtd = 2 * Val(Text14) * Val(Text19) / Val(Text28) / Val(Text29) / Val(Text30)
xte = 2 * Val(Text15) * Val(Text20) / Val(Text28) / Val(Text29) / Val(Text30)
Form3.Show
End Sub
-----------------------------------------
有些时候text28或者27中的数就是零了。。怎么处理不让他弹出窗口报错呢?