- UID
- 55924
- 好友
注册时间2010-8-11
威望值 点
最后登录1970-1-1
激情值 点
积分2
认证分 分
齿轮币 枚
回帖0
|
本帖子中包含更多资源。
您需要 登录 才可以下载或查看,没有账号?注册
x
我刚开始学vb,用它编了个选取差动挂轮的程序,但调试不出来,请教高手帮忙看看,指正
(查表法选取挂轮)
Option Explicit
Private Sub Command1_Click()
Dim i As Double, M As Double, L As Double, E As Double, K As Double, X As Double, n As Double
Dim a As Integer, b As Integer, c As Integer, d As Integer, c1 As Integer, c2 As Integer, c3 As Integer, c4 As Integer, j As Integer
Dim g
X = 6#
g = Array(20, 20, 23, 24, 24, 25, 26, 30, 32, 33, 34, 35, 36, 36, 37, 40, 41, 43, 45, 45, 45, 46, 47, 48, 48, 50, 52, 53, 55, 57, 58, 59, 60, 60, 61, 62, 65, 67, 70, 71, 73, 74, 75, 77, 79, 80, 82, 83, 85, 86, 89, 90, 92, 94, 95, 97, 98, 100)
M = Text1.Text
L = Text2.Text
E = Text3.Text
K = Text4.Text
i = (X * Sin(3.1415926 * b / 180)) / (M * K)
For c1 = 0 To 57
a = g(c1)
For c2 = 0 To 57
b = g(c2)
For c3 = 0 To 57
c = g(c3)
For c4 = 0 To 57
d = g(c4)
n = Abs(((a * c) / (b * d)) - i)
If ((n <= E) And (a + b - c > 15) And (c + d - b > 15) _
And (a <> b) And (b <> c) And (c <> d) And _
(a <> c) And (b <> d) And (a <> d)) Then
MsgBox (CStr(a) & CStr(b) & CStr(c) & CStr(d) & CStr(n))
End If
Next c4
Next c3
Next c2
Next c1
End Sub
|
|