当我执行全编译执行时vb提示:编译错误 变量未定义
PublicSubPutData(sInFilenameAsString)DimiNextFreeAsIntegerDimiCountAsInteger'findnext...
Public Sub PutData(sInFilename As String)
Dim iNextFree As Integer
Dim iCount As Integer
' find next free file number
iNextFree = FreeFile
' Read all the Data In
Open sInFilename For Output As iNextFree
For iCount = 0 To iSplineNumber
Print #1, Triangle(iYCount).A.x & " " & Triangle(iYCount).A.y & " " & Triangle(iYCount).A.z & " " & Triangle(iYCount).B.x & " " & Triangle(iYCount).B.y & " " & Triangle(iYCount).B.z & " " & Triangle(iYCount).C.x & " " & Triangle(iYCount).C.y & " " & Triangle(iYCount).C.z
Close iNextFree
End Sub
需要完整源码的给我发消息的 希望能帮忙纠正 展开
Dim iNextFree As Integer
Dim iCount As Integer
' find next free file number
iNextFree = FreeFile
' Read all the Data In
Open sInFilename For Output As iNextFree
For iCount = 0 To iSplineNumber
Print #1, Triangle(iYCount).A.x & " " & Triangle(iYCount).A.y & " " & Triangle(iYCount).A.z & " " & Triangle(iYCount).B.x & " " & Triangle(iYCount).B.y & " " & Triangle(iYCount).B.z & " " & Triangle(iYCount).C.x & " " & Triangle(iYCount).C.y & " " & Triangle(iYCount).C.z
Close iNextFree
End Sub
需要完整源码的给我发消息的 希望能帮忙纠正 展开
展开全部
一个变量未定义,还少了一个next,改好了
Public Sub PutData(sInFilename As String)
Dim iNextFree As Integer
Dim iYCount As Integer
' find next free file number
iNextFree = FreeFile
' Read all the Data In
Open sInFilename For Output As iNextFree
For iYCount = 0 To iSplineNumber
Print #1, Triangle(iYCount).A.x & " " & Triangle(iYCount).A.y & " " & Triangle(iYCount).A.z & " " & Triangle(iYCount).B.x & " " & Triangle(iYCount).B.y & " " & Triangle(iYCount).B.z & " " & Triangle(iYCount).C.x & " " & Triangle(iYCount).C.y & " " & Triangle(iYCount).C.z
Next
Close iNextFree
End Sub
Public Sub PutData(sInFilename As String)
Dim iNextFree As Integer
Dim iYCount As Integer
' find next free file number
iNextFree = FreeFile
' Read all the Data In
Open sInFilename For Output As iNextFree
For iYCount = 0 To iSplineNumber
Print #1, Triangle(iYCount).A.x & " " & Triangle(iYCount).A.y & " " & Triangle(iYCount).A.z & " " & Triangle(iYCount).B.x & " " & Triangle(iYCount).B.y & " " & Triangle(iYCount).B.z & " " & Triangle(iYCount).C.x & " " & Triangle(iYCount).C.y & " " & Triangle(iYCount).C.z
Next
Close iNextFree
End Sub
展开全部
已经提示你很清楚了, Print #1, Triangle(iYCount).A.x 中的 iYCount 在哪里定义的?
追问
怎样解决?
追答
我感觉你是不是写错了?iYcount=iCount
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
在该定义的地方去定义该变量呀。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你这个没有声明强制定义 不应该出现如此
要说没定义的 还真有几个
不知道你是不是在别的地方生命了全局变量
要说没定义的 还真有几个
不知道你是不是在别的地方生命了全局变量
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询