主题:求助,没学过VB,系统用不了C++图形模式,求大牛帮忙改改下面的程序,看看哪里语法错了,万谢。
Private Sub Form_Click()
Dim dx As Integer 'x坐标
Dim dy As Integer 'y坐标
Dim dz As Integer 'z坐标
Dim ld As Integer '画线顺序
Dim tl As Integer '相邻两点间是否画线
dx = Array(0, 10, 10, 0, 0, 0, 10, 10)
dy = Array(0, 0, 10, 10, 10, 0, 0, 10)
dz = Array(0, 0, 0, 0, 10, 10, 10, 10)
ld = Array(0, 1, 2, 3, 4, 5, 6, 7, 4, 3, 0, 5, 6, 1, 7, 2)
tl = Array(0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1)
Dim n As Integer
Dim l As Integer
n = -5
l = -5
Call Zhu(dx, dy, dz, ld, tl, n, l)
Call Fu(dx, dy, dz, ld, tl, n, l)
Call Zuo(dx, dy, dz, ld, tl, n, l)
End Sub
Sub Zhu(dx As Integer, dy As Integer, dz As Integer, ld As Integer, tl As Integer, n As Integer, l As Integer)
Dim j As Integer
Dim i As Integer
Dim x As Integer
Dim y As Integer
For i = 0 To 15
j = ld(i)
x = -dx(j)
y = dz(j)
If (tl(i) = 0) Then PSet (x, y)
Else: Line -(x, y)
Next i
End Sub
Sub Fu(dx As Integer, dy As Integer, dz As Integer, ld As Integer, tl As Integer, n As Integer, l As Integer)
Dim j As Integer
Dim i As Integer
Dim x As Integer
Dim y As Integer
For i = 0 To 15
j = ld(i)
x = -dx(j)
y = -y + n
If (tl(i) = 0) Then PSet (x, y)
Else: Line -(x, y)
Next i
End Sub
Sub Zuo(dx As Integer, dy As Integer, dz As Integer, ld As Integer, tl As Integer, n As Integer, l As Integer)
Dim j As Integer
Dim i As Integer
Dim x As Integer
Dim y As Integer
For i = 0 To 15
j = ld(i)
x = -dy(j) - l
y = dz(j)
If (tl(i) = 0) Then PSet (x, y)
Else: Line -(x, y)
Next i
End Sub
Sub Zhou(dx As Integer, dy As Integer, dz As Integer, ld As Integer, tl As Integer, n As Integer, l As Integer)
Dim j As Integer
Dim i As Integer
Dim x As Integer
Dim y As Integer
For i = 0 To 15
j = ld(i)
x = -0.7071 * dx(j) + 0.7017 * dy(j)
y = 0.4082 * (dx(j) + dy(j)) + 0.5773 * dz(j)
If (tl(i) = 0) Then PSet (x, y)
Else: Line -(x, y)
Next i
End Sub
Dim dx As Integer 'x坐标
Dim dy As Integer 'y坐标
Dim dz As Integer 'z坐标
Dim ld As Integer '画线顺序
Dim tl As Integer '相邻两点间是否画线
dx = Array(0, 10, 10, 0, 0, 0, 10, 10)
dy = Array(0, 0, 10, 10, 10, 0, 0, 10)
dz = Array(0, 0, 0, 0, 10, 10, 10, 10)
ld = Array(0, 1, 2, 3, 4, 5, 6, 7, 4, 3, 0, 5, 6, 1, 7, 2)
tl = Array(0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1)
Dim n As Integer
Dim l As Integer
n = -5
l = -5
Call Zhu(dx, dy, dz, ld, tl, n, l)
Call Fu(dx, dy, dz, ld, tl, n, l)
Call Zuo(dx, dy, dz, ld, tl, n, l)
End Sub
Sub Zhu(dx As Integer, dy As Integer, dz As Integer, ld As Integer, tl As Integer, n As Integer, l As Integer)
Dim j As Integer
Dim i As Integer
Dim x As Integer
Dim y As Integer
For i = 0 To 15
j = ld(i)
x = -dx(j)
y = dz(j)
If (tl(i) = 0) Then PSet (x, y)
Else: Line -(x, y)
Next i
End Sub
Sub Fu(dx As Integer, dy As Integer, dz As Integer, ld As Integer, tl As Integer, n As Integer, l As Integer)
Dim j As Integer
Dim i As Integer
Dim x As Integer
Dim y As Integer
For i = 0 To 15
j = ld(i)
x = -dx(j)
y = -y + n
If (tl(i) = 0) Then PSet (x, y)
Else: Line -(x, y)
Next i
End Sub
Sub Zuo(dx As Integer, dy As Integer, dz As Integer, ld As Integer, tl As Integer, n As Integer, l As Integer)
Dim j As Integer
Dim i As Integer
Dim x As Integer
Dim y As Integer
For i = 0 To 15
j = ld(i)
x = -dy(j) - l
y = dz(j)
If (tl(i) = 0) Then PSet (x, y)
Else: Line -(x, y)
Next i
End Sub
Sub Zhou(dx As Integer, dy As Integer, dz As Integer, ld As Integer, tl As Integer, n As Integer, l As Integer)
Dim j As Integer
Dim i As Integer
Dim x As Integer
Dim y As Integer
For i = 0 To 15
j = ld(i)
x = -0.7071 * dx(j) + 0.7017 * dy(j)
y = 0.4082 * (dx(j) + dy(j)) + 0.5773 * dz(j)
If (tl(i) = 0) Then PSet (x, y)
Else: Line -(x, y)
Next i
End Sub