VB 中实时错误6,那位大神,帮忙看看!

PrivateSubCommand1_Click()DimtjmAsStringDimtjsz()AsStringDimsjwjmAsStringDimsz()AsStr... Private Sub Command1_Click()
Dim tjm As String
Dim tjsz() As String
Dim sjwjm As String
Dim sz() As String
Dim Trip As String
Dim Ab As Double
Dim A As String
Dim DMM As String
Dim qdj, XL, YL, XR, YR, DY, DX, ddy, ddx, X, Y, gc As Double
Dim wjm As String
wjm = "HYDMKZ.DAT"
DMM = Text1
'==========================================================================
Open wjm For Input As #4
Do While Not EOF(4)
Line Input #4, Trip
sz() = Split(Trip, ",")

If sz(0) = sjwjm And sz(1) = "L1" Then
XL = Val(sz(2))
YL = Val(sz(3))
Else

End If
If sz(0) = sjwjm And sz(1) = "R1" Then
XR = Val(sz(2))
YR = Val(sz(3))
Else

End If
Loop
Close #4
Const PI = 3.1415926
DX = XR - XL
DY = YR - YL
Ab = Atn(Abs(DY / DX)) * 180 / PI
If DX > 0 And DY > 0 Then A = Ab
If DX > 0 And DY < 0 Then A = 360 - Ab
If DX < 0 And DY > 0 Then A = 180 - Ab
If DX < 0 And DY < 0 Then A = 180 + Ab

Open DMM & ".CG2" For Input As #10
Open DMM + ".ZB" For Output As #3
N = 0
Do While Not EOF(10)
Line Input #10, tp
tjsz = Split(tp, ",")
qdj = tjsz(0)
gc = tjsz(1)
bz = tjsz(2)
N = N + 1
'======================================================================================
ddy = Abs(qdj) * Sin(A)
ddx = Abs(qdj) * Cos(A)
X = XL + ddx
Y = YL + ddy
If bz = "左水边" Then bz = "ZSB"
If bz = "右水边" Then bz = "YSB"
If bz = "边滩" Then bz = "BT"
If bz = "草地" Then bz = "CD"
If bz = "坎脚" Then bz = "KJ"
If bz = "坎边" Then bz = "KB"
If bz = "坎腰" Then bz = "KY"
If bz = "洲水边" Then bz = "ZHOUSB"
If bz = "江心洲" Then bz = "JXZ"
If bz = "树林地" Then bz = "SLD"
If bz = "耕地" Then bz = "GD"
If bz = "土台" Then bz = "TT"
If bz = "水下" Then bz = "SX"
If bz = "石地" Then bz = "SD"
If bz = "套水边" Then bz = "TAOSB"
If bz = "滩地" Then bz = "TD"
If bz = "塘水边" Then bz = "TSB"
If bz = "砼地" Then bz = "TONGD"

Print #3, DMM; "-"; N; Format$(X, "###.000"); ","; Format$(Y, "###.000"); ","; gc; ","; bz
Loop
Close #10
Close #3

MsgBox "计算完成,谢谢使用!", vbInformation, "FAN"
End Sub
提示出在Ab = Atn(Abs(DY / DX)) * 180 / PI
展开
 我来答
yfcp
2014-11-24 · 知道合伙人软件行家
yfcp
知道合伙人软件行家
采纳数:1748 获赞数:5545
有多年网站建设相关工作经验。熟悉ASP、ASP.net、VB、JavaScript、HTML等语言和CSS、Ajax等相关技术。

向TA提问 私信TA
展开全部
具体哪行出错,程序应该有提示的,你应该指出来。
目测 sz() = Split(Trip, ",") 这个有问题,改成sz= Split(Trip, ",")
追问
提示出在Ab = Atn(Abs(DY / DX)) * 180 / PI这一行

改后一样的
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式