| 发表于:2007-08-02 16:39:49 楼主 |
从txt文件从某行开始读,将数据赋值给一个数组 还是下标越界啊 private sub command1_click() dim filet() as byte, filelen as long, strt() as string, i as long dim b(2) as string dim data() as string, a() as long dim n as long open "e:\3.txt " for binary as #1 filelen = lof(1) redim filet(filelen - 1) get #1, , filet filet = strconv(filet, vbunicode) strt = split(filet, vbcrlf) '然后假如说你从第7行开始取值给b n = 0 for x = 6 to ubound(strt) b(x - 6) = strt(x) 'debug.print b(x - 6) data = split(b(x - 6), " ") redim a(ubound(data)) for i = 0 to ubound(data) a(n) = val(data(i))-------错误行 n = n + 1 print a(i) next i next end sub 我的data肯定是有数据的啊 print data(i)都没有问题 |
|
|
|
|