Dim enword() as byte
Open "MYFILE.TXT" For Input As #1
Randomize
rand = Int(7 * Rnd)
Do While Not EOF(1)
Line Input #1, strdata
enword() = strdata;这句报错
cnt = cnt + 1
If cnt > rand Then
Exit Do
End If
Loop
我想把得到的随机字符串读取到数组中进行操作,该如何写,如果我的数组是二维数组,想存取多个字符串,又该如何操作
Open "MYFILE.TXT" For Input As #1
Randomize
rand = Int(7 * Rnd)
Do While Not EOF(1)
Line Input #1, strdata
enword() = strdata;这句报错
cnt = cnt + 1
If cnt > rand Then
Exit Do
End If
Loop
我想把得到的随机字符串读取到数组中进行操作,该如何写,如果我的数组是二维数组,想存取多个字符串,又该如何操作
解决方案 »
- 如何得到数组中相同的数并计算个数
- VB 高手请进.请问如何在程序窗体一个小方框内显示互联网上http://xxx.xxx.com/1.jpg图片并超级链接?
- (VB求助)可不可以为Form添加滚动条,如果可以应该怎样添加,并实现滚动条的功能!
- 请大家分享一下VB用ADO联接数据库的方法。
- 关于滚动条的问题,哪位会的兄弟帮帮忙!解决了立刻给分!分不够再加!
- 在线求教!vb保存的问题?
- 请教一下,如何把运算运程中的结果输出到一个记事本文件中或其他的??
- 请问vb中实现c语言中continue语句功能的语句是什么?
- NT对win98发送消息,怎么用vb写这个程序?
- 我刚刚遇到了一个变量问题,想请教一下,我很急,因为我正在写程序。谢谢!
- 实时监控的问题(在线等)
- mshflexgrid控件右键弹出菜单问题,高手请进!!
dim i as integer
Open "MYFILE.TXT" For Input As #1
Randomize
rand = Int(7 * Rnd)
i=0
redim enword(0 to 0)
Do While Not EOF(1) Line Input #1, strdata
redim preserve enword(0 to i)
enword(i)=strdata
i=i+1
cnt = cnt + 1
If cnt > rand Then
Exit Do
End If
Loop
Open "MYFILE.TXT" For Input As #1
Randomize
rand = Int(7 * Rnd)
Do While Not EOF(1)
Line Input #1, strdata
enword = strconv(strdata,vbunicode);这句这么改
cnt = cnt + 1
If cnt > rand Then
Exit Do
End If
Loop