Sub OnLButtonDown(ByVal Item, ByVal Flags, ByVal x, ByVal y)
Const ForReading = 1
Dim fso
Set fso = CreateObject("s cripting.FileSystemObject")
Dim txtFile,szContent
Set txtFile = fso.OpenTextFile("E:\DATA.TXT",ForReading)
szContent =txtFile.ReadAll
txtFile.close
Dim iReadRow,iReadCol
iReadRow = 3
iReadCol = 2
Dim RowsContent
RowsContent = Split(szContent,vbCrLf) '#按回车符分割数组
Dim ColsContent
ColsContent = Split(RowsContent(iReadRow-1)," ") '#RowsContent(iReadRow-1)即为第n行的数据
HMIRuntime.Trace "The Data is :" & ColsContent(iReadCol-1) & vbCrLf
End Sub
最佳答案
ms没有啥错误,最好跟踪一下在哪句出错了
提问者对于答案的评价:
一个空格键引发的血案
专家置评
已阅,最佳答案正确。
原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc131536.html